Merge lp://staging/~gary/juju-gui/core-sub-num-units into lp://staging/juju-gui/experimental
Proposed by
Gary Poster
Status: | Merged |
---|---|
Merged at revision: | 887 |
Proposed branch: | lp://staging/~gary/juju-gui/core-sub-num-units |
Merge into: | lp://staging/juju-gui/experimental |
Diff against target: |
126 lines (+45/-22) 4 files modified
app/store/env/fakebackend.js (+9/-9) app/templates/charm-pre-configuration.handlebars (+14/-10) app/views/charm-panel.js (+2/-2) test/test_fakebackend.js (+20/-1) |
To merge this branch: | bzr merge lp://staging/~gary/juju-gui/core-sub-num-units |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email:
|
Description of the change
Subordinates should not be deployed with unit ct.
Deploying a subordinate with a unit count causes an error in core. This
prevents one from entering a unit count in the charm panel (did not touch ghost
inspector, that may also need it) and defaults to 0. This also affects
fakebackend.
To post a comment you must log in.
Reviewers: mp+176682_ code.launchpad. net,
Message:
Please take a look.
Description:
Subordinates should not be deployed with unit ct.
Deploying a subordinate with a unit count causes an error in core. This
prevents one from entering a unit count in the charm panel (did not
touch ghost
inspector, that may also need it) and defaults to 0. This also affects
fakebackend.
https:/ /code.launchpad .net/~gary/ juju-gui/ core-sub- num-units/ +merge/ 176682
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/11627044/
Affected files: env/fakebackend .js charm-pre- configuration. handlebars charm-panel. js fakebackend. js
A [revision details]
M app/store/
M app/templates/
M app/views/
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-07-09 15:11:25 +0000 fakebackend. js 2013-07-24 13:06:18 +0000
assert. isUndefined( charm.get( 'is_subordinate '));
charm. _set('is_ subordinate' , true); deploy( 'cs:wordpress' , callback); deploy( 'cs:wordpress' , callback, {unitCount: 0});
assert. isUndefined( result. error);
assert. strictEqual(
fakebacken d.db.charms. getById( 'cs:precise/ wordpress- 10'), charm);
'Invalid number of units.');
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -168,7 +168,7 @@
// The _set forces a change to a writeOnly attribute.
- fakebackend.
+ fakebackend.
@@ -859,6 +859,25 @@
});
+ it('returns error for invalid number of subordinate units', function() deploy( 'cs:puppet' , callback); isUndefined( deployResult. error); addUnit( 'puppet' , 'goyesca').error, addUnit( 'puppet' , 1).error, addUnit( 'puppet' , -1).error, addUnit( 'puppet' , 0).error); addUnit( 'puppet' ).error) ;
assert. equal(
fakebacken d.addUnit( 'foo'). error,
{
+ fakebackend.
+ assert.
+ assert.equal(
+ fakebackend.
+ 'Invalid number of units.');
+ assert.equal(
+ fakebackend.
+ 'Invalid number of units.');
+ assert.equal(
+ fakebackend.
+ 'Invalid number of units.');
+ // It also ignores empty requests
+ assert.isUndefined(
+ fakebackend.
+ assert.isUndefined(
+ fakebackend.
+ });
+
it('returns an error if the service does not exist.', function() {
Index: app/templates/ charm-pre- configuration. handlebars charm-pre- configuration. handlebars' charm-pre- configuration. handlebars 2013-07-17 19:25:41 charm-pre- configuration. handlebars 2013-07-24 13:03:35 charm-entry" > control- group"> description" >
=== modified file 'app/templates/
--- app/templates/
+0000
+++ app/templates/
+0000
@@ -26,18 +26,22 @@
</div>
</div>
</div>
- <div class="
- <div class="
- <div class="well control-
- Number of units to deploy for this service.
-...