Merge lp://staging/~bcsaller/pyjuju/delta-annotations into lp://staging/~hazmat/pyjuju/rapi-rollup

Proposed by Benjamin Saller
Status: Merged
Merged at revision: 631
Proposed branch: lp://staging/~bcsaller/pyjuju/delta-annotations
Merge into: lp://staging/~hazmat/pyjuju/rapi-rollup
Diff against target: 49 lines (+12/-5)
2 files modified
improv.py (+4/-4)
juju/rapi/delta.py (+8/-1)
To merge this branch: bzr merge lp://staging/~bcsaller/pyjuju/delta-annotations
Reviewer Review Type Date Requested Status
Kapil Thangavelu Pending
Review via email: mp+150451@code.staging.launchpad.net

Description of the change

Delta stream environment level annotations

There may be a better way to generate the delta for this, but this
works fine for the size of the annotation space on the env.

https://codereview.appspot.com/7382061/

To post a comment you must log in.
Revision history for this message
Benjamin Saller (bcsaller) wrote :

Reviewers: mp+150451_code.launchpad.net,

Message:
Please take a look.

Description:
Delta stream environment level annotations

There may be a better way to generate the delta for this, but this
works fine for the size of the annotation space on the env.

https://code.launchpad.net/~bcsaller/juju/delta-annotations/+merge/150451

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/7382061/

Affected files:
   A [revision details]
   M juju/rapi/delta.py

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>

Index: juju/rapi/delta.py
=== modified file 'juju/rapi/delta.py'
--- juju/rapi/delta.py 2013-01-18 17:00:39 +0000
+++ juju/rapi/delta.py 2013-02-25 22:21:40 +0000
@@ -126,7 +126,7 @@
          """Return current state as list of changes."""
          changes = []
          delta(
- {'machines': {}, 'services': {}, 'topology': None},
+ {'machines': {}, 'services': {}, 'topology':
None, 'annotations': {}},
              copy.deepcopy(self.previous), changes.append)
          return changes

@@ -272,3 +272,10 @@
          if svc != prev_svc:
              svc['id'] = sid
              stream(('service', 'change', svc))
+
+ # Add env annotations to the stream if need be.
+ cur_env = cur['annotations']
+ prev_env = prev.get('annotations', {})
+ if (sorted(cur_env.items()) !=
+ sorted(prev_env.items())):
+ stream(('annotations', 'change', cur['annotations']))

632. By Benjamin Saller

remove trailing slash

633. By Benjamin Saller

copy paste error

634. By Benjamin Saller

ok computer

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