New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 691572 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

factory: Find a way to maintain util code without dirty hacks regarding device API

Project Member Reported by hungte@chromium.org, Feb 13 2017

Issue description

To help sharing modules easily, we've set few rules, for example py/utils should not import things except python standard modules and py/utils itself.

However, that makes few primitive calls like system, mount, ... etc duplicated when we need to do same thing on DUT (using device API).

Currently we have few APIs in py/utils solving this by allowing a DUT arg, that if the arg is None then the API will try to use DUT API. However, this makes the logic in py/utils diverge and sometimes hard to maintain.

I wonder if there's some better way to simplify this, for example

  with dut as d:
    utils.DoSomething()  # will use d implicitly

  utils.DoSomething # will run locally

This is possible if we do some hack to the context stack, but maybe also making things more complicated.

Or, maybe we can change those utils into objects and return the remote execution command in __repr__.

Or, ... whatever.

This is an open issue and low priority. Feel free to re-assign, or think about any solution if you're available.
 

Comment 1 by hungte@chromium.org, Jul 26 2017

Cc: chromeos-factory-eng@google.com
Status: Assigned (was: Untriaged)

Sign in to add a comment