Merge lp://staging/~sinzui/juju-release-tools/delete-tools-from-azure into lp://staging/juju-release-tools

Proposed by Curtis Hovey
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
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Martin Packman (community) Approve
Review via email: mp+234555@code.staging.launchpad.net

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_publish_tools.py delete proposed juju-qa-schedule-2014-10.pdf
    Deleting proposed/juju-qa-schedule-2014-10.pdf

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_publish_tools.py list proposed
   ./azure_publish_tools.py list release
   ./azure_publish_tools.py list testing

   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 :)

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

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.

review: Approve
Revision history for this message
Aaron Bentley (abentley) wrote :

Looks good to me. Now that you're using argparse, you can use ArgumentParser.add_subparsers next time you add a command :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches