summaryrefslogtreecommitdiff
path: root/funcs.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-05-10 10:25:57 +0300
committerLars Wirzenius <liw@liw.fi>2020-05-10 11:13:07 +0300
commit90d3d8748a5c4c8d52e1ccc7da5110c01e834b98 (patch)
tree61d4c36eae1f9d4ae1c9b44aacc3005962c4c7c0 /funcs.py
parentfd2cc1d6b35fba4ba99d4221068c48be74413d34 (diff)
downloadick-contractor-90d3d8748a5c4c8d52e1ccc7da5110c01e834b98.tar.gz
refactor: use argparse instead of cliapp
cliapp is an old, moribund Python project of mine, and argparse is the preferred way to parse the command line now.
Diffstat (limited to 'funcs.py')
-rw-r--r--funcs.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/funcs.py b/funcs.py
index 0d157a8..2172cc2 100644
--- a/funcs.py
+++ b/funcs.py
@@ -25,13 +25,13 @@ def _run(ctx, argv):
# the address of the manager VM from CONTRACTOR_ADDRESS in the
# environment.
def _contractor():
- addr = os.environ['CONTRACTOR_ADDRESS']
- return [
- os.path.join(srcdir, 'contractor'),
- '--no-default-config',
- '--log', os.path.join(srcdir, 'contractor.log'),
- '--manager-address', addr,
- ]
+ return [os.path.join(srcdir, 'contractor')]
+
+
+# Return manager address.
+def _manager_address():
+ return os.environ['CONTRACTOR_ADDRESS']
+
#############################################################################
@@ -45,7 +45,7 @@ def nop(ctx, **kwargs):
# Check that we can access the contractor VM.
# FIXME: this hardcodes some things.
def contractor_is_working(ctx):
- argv = _contractor() + ['manager-status']
+ argv = _contractor() + ['status', '-m', _manager_address()]
_run(ctx, argv)
assert_eq(ctx['exit'], 0)
@@ -80,7 +80,7 @@ def run_contractor_dump(ctx, filename=None):
# Run the contractor to do a build.
def run_contractor_build(ctx, filename=None):
- argv = _contractor() + ['build', filename]
+ argv = _contractor() + ['build', filename, '-m', _manager_address()]
_run(ctx, argv)