Merge lp:~bac/juju-gui/fix-goof into lp:juju-gui/experimental
Proposed by
Brad Crittenden
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 501 | ||||
Proposed branch: | lp:~bac/juju-gui/fix-goof | ||||
Merge into: | lp:juju-gui/experimental | ||||
Diff against target: |
78 lines (+42/-3) 2 files modified
app/store/endpoints.js (+2/-2) test/test_endpoints.js (+40/-1) |
||||
To merge this branch: | bzr merge lp:~bac/juju-gui/fix-goof | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+157197@code.launchpad.net |
Description of the change
Fix bug in charm load handler.
To post a comment you must log in.
Reviewers: mp+157197_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix bug in charm load handler.
https:/ /code.launchpad .net/~bac/ juju-gui/ fix-goof/ +merge/ 157197
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/8364044/
Affected files: endpoints. js endpoints. 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_ endpoints. js endpoints. js' endpoints. js 2013-04-04 13:28:35 +0000 endpoints. js 2013-04-04 18:18:21 +0000
'juju- models' ,
'juju- tests-utils' ,
'juju- endpoints- controller' , rs'], local'] , 'juju') ; 'juju-tests. utils') ; db.charms. getById( charm_id) .destroy( );
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -292,7 +292,9 @@
- 'juju-controlle
+ 'juju-controllers',
+ 'juju-charm-store',
+ 'datasource-
function(Y) {
juju = Y.namespace(
utils = Y.namespace(
@@ -415,4 +417,40 @@
app.
});
+ it('should add the service to the endpoints map when the charm is wordpress- 2'; charms. add({id: charm_id}); endpointsMap. should. eql({}) ; charms. getById( charm_id) ; Local({ source: data})}); services. add({ charmStore, function(err, data) { charm.loaded) ; 'summary' ).should. equal(' wowza') ; endpointsMap. should. eql({
loaded',
+ function(done) {
+ var service_name = 'wordpress';
+ var charm_id = 'cs:precise/
+ app.db.
+ controller.
+ var charm = app.db.
+ var data = [
+ { responseText: Y.JSON.stringify(
+ { summary: 'wowza', subordinate: true, store_revision: 7 })}];
+ var charmStore = new juju.CharmStore({
+ datasource: new Y.DataSource.
+
+ app.db.
+ id: service_name,
+ pending: false,
+ charm: charm_id});
+
+ charm.load(
+ if (err) { assert.fail('should succeed!'); }
+ assert(
+ charm.get(
+
+ controller.
+ 'wordpress': {
+ provides: [],
+ requires: []
+ }});
+
+ done();
+ });
+
+
+ }
+ );
+
});
Index: app/store/ endpoints. js endpoints. js' endpoints. js 2013-04-04 14:21:31 +0000 endpoints. js 2013-04-04 18:18:21 +0000
setupCharmOn ceLoad: function(charm, svcName) {
charm. once('load' , Y.bind( function( svcName, evt) {
this.addService ToEndpointsMap( svcName, evt.currentTarget);
=== modified file 'app/store/
--- app/store/
+++ app/store/
@@ -111,7 +111,7 @@
- }, null, svcName));
+ }, this, svcName));
},
/**
.load( env,
// If views are bound to the charm mode...
@@ -133,7 +133,7 @@
charm = db.charms.add({id: charm_id})