Merge lp:~hatch/juju-gui/default-bundle-unit into lp:juju-gui/experimental
Proposed by
Jeff Pihach
Status: | Merged |
---|---|
Merged at revision: | 1168 |
Proposed branch: | lp:~hatch/juju-gui/default-bundle-unit |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
45 lines (+15/-2) 2 files modified
app/store/env/fakebackend.js (+8/-2) test/test_fakebackend.js (+7/-0) |
To merge this branch: | bzr merge lp:~hatch/juju-gui/default-bundle-unit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+193341@code.launchpad.net |
Description of the change
Handle unit numbers properly with subordinates
To post a comment you must log in.
Reviewers: mp+193341_ code.launchpad. net,
Message:
Please take a look.
Description:
Handle unit numbers properly with subordinates
https:/ /code.launchpad .net/~hatch/ juju-gui/ default- bundle- unit/+merge/ 193341
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/20040043/
Affected files (+17, -2 lines): env/fakebackend .js fakebackend. js
A [revision details]
M app/store/
M test/test_
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: test/test_ fakebackend. js fakebackend. js' fakebackend. js 2013-10-23 05:23:16 +0000 fakebackend. js 2013-10-30 21:58:08 +0000
assert. equal(result. machines[ 0].agent_ state, 'running');
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -1102,6 +1102,13 @@
});
+ it('deploys subordinates without adding units', function() { deploy( 'cs:precise/ puppet- 5', callback); equal(deployRes ult.service. get('name' ), 'puppet'); equal(deployRes ult.units. length, 0); equal(deployRes ult.service. get('units' ).size( ), 0);
fakebackend. deploy( 'cs:precise/ wordpress- 15', callback);
assert. isUndefined( deployResult. error);
+ fakebackend.
+ assert.
+ assert.
+ assert.
+ });
+
it('adds multiple units', function() {
Index: app/store/ env/fakebackend .js env/fakebackend .js' env/fakebackend .js 2013-10-23 05:17:56 +0000 env/fakebackend .js 2013-10-30 21:58:08 +0000
this.changes. services[ service. get('id' )] = [service, true]; options. name, options.unitCount); isValue( unitCount) && !charm. get('is_ subordinate' )) { options. name, unitCount);
response. service = service;
callback( response) ; unitCount) { unitCount = serviceData. num_units || 1; unitCount = serviceData. num_units; options) {
serviceDat a.config = serviceData. options;
=== modified file 'app/store/
--- app/store/
+++ app/store/
@@ -444,7 +444,13 @@
})()
});
- var response = this.addUnit(
+
+ var unitCount = options.unitCount;
+ if (!Y.Lang.
+ // This is the current behavior in both implementations.
+ unitCount = 1;
+ }
+ var response = this.addUnit(
},
@@ -1495,7 +1501,7 @@
// Map the argument name from the deployer format
// name for unit count.
if (!serviceData.
- serviceData.
+ serviceData.
}
if (serviceData.