mojo deploy-show can remove the content of a deploy file

Bug #1734059 reported by Junien F
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mojo: Continuous Delivery for Juju
Fix Released
High
Unassigned

Bug Description

Hi,

Running "mojo deploy-show --options config=~/spec/foo/bar/baz/services" empties the specified "services" file.

Is this a bug, or am I using deploy-show wrong ?

Thanks

Related branches

Changed in mojo:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Tom Haddon (mthaddon) wrote :

The "config" here should be "as seen by Mojo" rather than a full path. So if your deploy phase is "deploy config=services" you should be running "mojo deploy-show --options config=services". However, I can confirm if you use the full path here it does indeed wipe the contents of the file, and shouldn't.

Will dig in a bit.

Revision history for this message
Tom Haddon (mthaddon) wrote :

The offending bit of code is line 668 of mojo/phase.py. In this case config_src is a fully qualified path, so we do `os.path.join(one_fully_qualified_path, another_fully_qualified_path)` which returns `another_fully_qualified_path` rather than `one_fully_qualified_path+another_fully_qualified_path`.

Need to figure out how we should handle this. Likely we should error if someone tries to pass a fully qualified path as a config option.

Revision history for this message
Tom Haddon (mthaddon) wrote :

This has been fixed and released in the snap. The package is currently being copied from the proposed PPA to the main release PPA, so marking this bug as fix released.

Changed in mojo:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.