Merge lp://staging/~sinzui/juju-release-tools/delete-tools-from-azure into lp://staging/juju-release-tools
Status: | Merged |
---|---|
Merged at revision: | 58 |
Proposed branch: | lp://staging/~sinzui/juju-release-tools/delete-tools-from-azure |
Merge into: | lp://staging/juju-release-tools |
Diff against target: |
210 lines (+66/-43) 1 file modified
azure_publish_tools.py (+66/-43) |
To merge this branch: | bzr merge lp://staging/~sinzui/juju-release-tools/delete-tools-from-azure |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | Approve | ||
Martin Packman (community) | Approve | ||
Review via email:
|
Description of the change
This branch extracts the delete blobs additions I added to clean azure. The change was made on top of my working branch that was introduced "proposed". Since "proposed" and "devel" are compatible with this change, I decided to finish this one part to make my next branch smaller.
1. Added a command and method to delete files. You can pass one or more paths. This was
run successfully. As this change was accidentally sitting on top of my "proposed"
addition, I had an opportunity to test this a file I uploaded for testing. eg:
./azure_
Deleting proposed/
2. I added "proposed" and "devel" purposes. They are synonymous with the top-level paths
in juju-dist. They follow the pattern of "testing". Adding more purposes made it
obvious that I could rethink the code that handles prefixes and replacements:
A. prefix is used to match the subtree, and there was a clause to exclude files because
the listing included files that didn't match "release". Listing gets faster by
always providing a prefix to match axure files...release == tools/, all other
conditions the purpose matches the prefix.
B. replacements is a used to convert the local file path to the remote path. Like
prefix "release" is tools, otherwise purpose is the start of the path.
Since I preseeded proposed when I wrote this code, you can see this work eg.
./azure_
./azure_
./azure_
As the listings and the point 1 implies, I really have published and deleted to propised.
3. I switched to ArgumentParser
I can add tests after my other conflated branch with the test base is merged. Oh! You may have wondered why my other branch explicitly finds tests in ./test/, it is because the azure lib this module uses is embedded in our tree, it has tests, and the don't pass :)
LGTM. Using the subcommand style like these seems okay unless any of them are likely to grow more specific suboptions, it's a little neater with argparse.