$CWD is used in the lookup of files during mojo run
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mojo: Continuous Delivery for Juju |
Confirmed
|
Medium
|
Unassigned |
Bug Description
During a mojo if a file is referenced with a relative path in a script the lookup is also done in the current working directoy.
I think it should fail if the relative path is wrong, instead of using the CWD
Steps to reproduce:
1) setup the env
bzr branch lp:~verterok/+junk/test-spec
cd test-spec
# bootstrap a juju env
# create the project
sudo mojo project-new mojo-test-spec -s trusty
# fix perms of lxc
sudo chmod 750 /var/lib/
sudo chgrp $USER /var/lib/
sudo chgrp $USER /var/lib/
# create the workspace
mojo workspace-new --project mojo-test-spec -s trusty --stage "foo/bar/devel" `bzr root` bug-relative-path
2) error case:
mojo run --project mojo-test-spec --series trusty --stage foo/bar/devel `bzr root` bugs-relative-path
output:
2015-05-08 13:04:19 [INFO] Retrieve the spec's manifest
2015-05-08 13:04:19 [INFO] Building resource tree
2015-05-08 13:04:20 [INFO] Build a charm repository
2015-05-08 13:04:20 [INFO] Creating charm repo automatically from all charms in the build directory.
2015-05-08 13:04:20 [INFO] Pulling secrets from /srv/mojo/
2015-05-08 13:04:20 [WARNING] Automatic secrets phase ran but secrets directory /srv/mojo/
2015-05-08 13:04:20 [INFO] Running juju-deployer
Running: python /usr/bin/
2015-05-08 13:04:20 [DEBUG] deployer.cli: Using runtime GoEnvironment on local
2015-05-08 13:04:20 [INFO] deployer.cli: Starting deployment of test-services
2015-05-08 13:04:20 [DEBUG] deployer.import: Getting charms...
2015-05-08 13:04:20 [DEBUG] deployer.deploy: Resolving configuration
2015-05-08 13:04:20 [DEBUG] deployer.env: Connecting to environment...
2015-05-08 13:04:21 [DEBUG] deployer.env: Connected to environment
2015-05-08 13:04:21 [INFO] deployer.import: Deploying services...
2015-05-08 13:04:21 [DEBUG] deployer.import: <deployer.
2015-05-08 13:04:27 [DEBUG] deployer.import: Adding units...
2015-05-08 13:04:27 [DEBUG] deployer.import: Waiting for units before adding relations
2015-05-08 13:04:28 [DEBUG] deployer.env: Connecting to environment...
2015-05-08 13:04:29 [DEBUG] deployer.env: Connected to environment
2015-05-08 13:04:29 [INFO] deployer.import: Adding relations...
2015-05-08 13:04:29 [INFO] deployer.cli: Deployment complete in 8.98 seconds
2015-05-08 13:04:29 [INFO] Pulling secrets from /srv/mojo/
2015-05-08 13:04:29 [WARNING] Automatic secrets phase ran but secrets directory /srv/mojo/
2015-05-08 13:04:29 [INFO] Running script test-script
/srv/mojo/
3) happy path, change CWD to the spec root: foo/bar
cd foo/bar
mojo run --project mojo-test-spec --series trusty --stage foo/bar/devel `bzr root` bugs-relative-path
output:
2015-05-08 13:04:37 [INFO] Retrieve the spec's manifest
2015-05-08 13:04:37 [INFO] Building resource tree
2015-05-08 13:04:37 [INFO] Build a charm repository
2015-05-08 13:04:37 [INFO] Creating charm repo automatically from all charms in the build directory.
2015-05-08 13:04:37 [INFO] Pulling secrets from /srv/mojo/
2015-05-08 13:04:37 [WARNING] Automatic secrets phase ran but secrets directory /srv/mojo/
2015-05-08 13:04:37 [INFO] Running juju-deployer
Running: python /usr/bin/
2015-05-08 13:04:37 [DEBUG] deployer.cli: Using runtime GoEnvironment on local
2015-05-08 13:04:37 [INFO] deployer.cli: Starting deployment of test-services
2015-05-08 13:04:37 [DEBUG] deployer.import: Getting charms...
2015-05-08 13:04:37 [DEBUG] deployer.deploy: Resolving configuration
2015-05-08 13:04:37 [DEBUG] deployer.env: Connecting to environment...
2015-05-08 13:04:38 [DEBUG] deployer.env: Connected to environment
2015-05-08 13:04:38 [INFO] deployer.import: Deploying services...
2015-05-08 13:04:38 [DEBUG] deployer.import: <deployer.
2015-05-08 13:04:44 [DEBUG] deployer.import: Adding units...
2015-05-08 13:04:44 [DEBUG] deployer.import: Waiting for units before adding relations
2015-05-08 13:04:45 [DEBUG] deployer.env: Connecting to environment...
2015-05-08 13:04:46 [DEBUG] deployer.env: Connected to environment
2015-05-08 13:04:46 [INFO] deployer.import: Adding relations...
2015-05-08 13:04:46 [INFO] deployer.cli: Deployment complete in 8.86 seconds
2015-05-08 13:04:46 [INFO] Pulling secrets from /srv/mojo/
2015-05-08 13:04:46 [WARNING] Automatic secrets phase ran but secrets directory /srv/mojo/
2015-05-08 13:04:46 [INFO] Running script test-script
ÄLL GOOD
description: | updated |
tags: | added: papercut |
Changed in mojo: | |
status: | New → Confirmed |
importance: | Undecided → Medium |