GitLab maintenance scheduled for Tomorrow, 2019-03-26, from 12:00 to 13:00 CDT - Services will be unavailable during this time.

Commit 9aeabeee authored by Swann Perarnau's avatar Swann Perarnau

Merge branch '8-bad-relative-path-handling-between-command-line-client-and-daemon' into 'master'

Resolve "Bad relative path handling between command line client and daemon"

Closes #8

See merge request !38
parents 3dd86585 8734b138
Pipeline #4681 passed with stages
in 2 minutes and 13 seconds
...@@ -77,9 +77,18 @@ class CommandLineInterface(object): ...@@ -77,9 +77,18 @@ class CommandLineInterface(object):
# the command idempotent. # the command idempotent.
environ = os.environ environ = os.environ
container_uuid = argv.ucontainername or str(uuid.uuid4()) container_uuid = argv.ucontainername or str(uuid.uuid4())
# simple check + error msg + non-zero return code
def sanitize_manifest(path):
if os.path.isfile(path):
return(os.path.abspath(path))
else:
logger.error("Manifest file not found: %s", path)
sys.exit(1)
command = {'api': 'up_rpc_req', command = {'api': 'up_rpc_req',
'type': 'run', 'type': 'run',
'manifest': argv.manifest, 'manifest': sanitize_manifest(argv.manifest),
'path': argv.command, 'path': argv.command,
'args': argv.args, 'args': argv.args,
'environ': dict(environ), 'environ': dict(environ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment