OLD | NEW |
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 /** | 3 /** |
4 An in-memory fake Juju backend and supporting elements. | 4 An in-memory fake Juju backend and supporting elements. |
5 | 5 |
6 @module env | 6 @module env |
7 @submodule env.fakebackend | 7 @submodule env.fakebackend |
8 */ | 8 */ |
9 | 9 |
10 YUI.add('juju-env-fakebackend', function(Y) { | 10 YUI.add('juju-env-fakebackend', function(Y) { |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 charmStore's loadByPath method. | 334 charmStore's loadByPath method. |
335 @return {Object} A matching charm from the db. | 335 @return {Object} A matching charm from the db. |
336 */ | 336 */ |
337 _getCharmFromData: function(data) { | 337 _getCharmFromData: function(data) { |
338 var charm = this.db.charms.getById(data.store_url); | 338 var charm = this.db.charms.getById(data.store_url); |
339 if (!charm) { | 339 if (!charm) { |
340 delete data.store_revision; | 340 delete data.store_revision; |
341 delete data.bzr_branch; | 341 delete data.bzr_branch; |
342 delete data.last_change; | 342 delete data.last_change; |
343 data.id = data.store_url; | 343 data.id = data.store_url; |
| 344 data.is_subordinate = data.subordinate; |
| 345 delete data.subordinate; |
344 charm = this.db.charms.add(data); | 346 charm = this.db.charms.add(data); |
345 } | 347 } |
346 return charm; | 348 return charm; |
347 }, | 349 }, |
348 | 350 |
349 /** | 351 /** |
350 Deploy a charm, given the charm, a callback, and options. | 352 Deploy a charm, given the charm, a callback, and options. |
351 | 353 |
352 @param {Object} charm The charm to be deployed, from the db. | 354 @param {Object} charm The charm to be deployed, from the db. |
353 @param {Function} callback A call that will receive an object either | 355 @param {Function} callback A call that will receive an object either |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 | 1034 |
1033 Y.namespace('juju.environments').FakeBackend = FakeBackend; | 1035 Y.namespace('juju.environments').FakeBackend = FakeBackend; |
1034 | 1036 |
1035 }, '0.1.0', { | 1037 }, '0.1.0', { |
1036 requires: [ | 1038 requires: [ |
1037 'base', | 1039 'base', |
1038 'js-yaml', | 1040 'js-yaml', |
1039 'juju-models' | 1041 'juju-models' |
1040 ] | 1042 ] |
1041 }); | 1043 }); |
OLD | NEW |