~makyo/juju-gui/rel-prep

« back to all changes in this revision

Viewing changes to app/store/env/fakebackend.js

  • Committer: Benjamin Saller
  • Author(s): Benjamin Saller
  • Date: 2013-10-10 17:06:41 UTC
  • mfrom: (1108.2.4 restore-bundle-annotations)
  • Revision ID: bcsaller@gmail.com-20131010170641-igy2gv5i6qsinl4s
Fix annotations on go backend

Fix annotation roundtrips with go backend
      Splits how we prepare deltas for py/go juju fakebackends
      Change test expectations to merge updateAnnotation calls
  
  Fix import of constraints
  Fix export of undefined/default values
  
  Adjust simulator unit count rate of change.

R=benjamin.saller, gary.poster, jeff.pihach
CC=
https://codereview.appspot.com/14485046

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
            // invalid charm pointing to a bad URL and a read of a
325
325
            // 404 giving an error at this level. IOError isn't user
326
326
            // facing so we log the warning.
327
 
            console.warn('error loading charm: ' + e.error);
 
327
            console.warn('error loading charm: ', e);
328
328
            if (callbacks.failure) {
329
329
              callbacks.failure(
330
330
                  {error: 'Error interacting with the charmworld API.'});
409
409
      // needs to be an array, so we are converting it back to an object
410
410
      // here so that the GUI displays it properly.
411
411
      var constraintsMap = {}, vals;
 
412
      if (typeof constraints === 'string') {
 
413
        constraints = constraints.split(',');
 
414
      }
412
415
      if (Y.Lang.isArray(constraints)) {
413
416
        constraints.forEach(function(cons) {
414
417
          vals = cons.split('=');
1057
1060
        existing = {};
1058
1061
      }
1059
1062
 
1060
 
      annotations = Y.merge(existing, annotations, true, 0, null, true);
1061
 
      models.setAnnotations(entity, annotations);
1062
 
 
 
1063
      models.setAnnotations(entity, annotations, true);
1063
1064
      // Arrange delta stream updates.
1064
1065
      var annotationGroup = this._getAnnotationGroup(entity);
1065
1066
      this.annotations[annotationGroup][entityName] = entity;