ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxmrlv <...@git.apache.org>
Subject [GitHub] incubator-ariatosca pull request #129: ARIA-213 Sporadic tests failures over...
Date Thu, 11 May 2017 13:26:04 GMT
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/129#discussion_r115981331
  
    --- Diff: aria/storage/instrumentation.py ---
    @@ -177,22 +232,30 @@ def apply_tracked_changes(tracked_changes, model):
                     instance = None
                     for attribute_name, value in tracked_attributes.items():
                         if value.initial != value.current:
    -                        if not instance:
    -                            instance = mapi.get(instance_id)
    +                        instance = instance or mapi.get(instance_id)
                             setattr(instance, attribute_name, value.current)
                     if instance:
                         _validate_version_id(instance, mapi)
                         mapi.update(instance)
                         successfully_updated_changes[mapi_name][instance_id] = [
                             v.dict for v in tracked_attributes.values()]
    +
    +        for mapi_name, new_instance in new_instances.items():
    +            successfully_updated_changes[mapi_name] = dict()
    +            mapi = getattr(model, mapi_name)
    +            for new_instance_kwargs in sorted(new_instance.values()):
    +                instance = mapi.model_cls(**new_instance_kwargs)
    +                mapi.put(instance)
    +                successfully_updated_changes[mapi_name][instance.id] = new_instance_kwargs
         except BaseException:
             for key, value in successfully_updated_changes.items():
                 if not value:
                     del successfully_updated_changes[key]
    -        model.logger.error(
    -            'Registering all the changes to the storage has failed. {0}'
    -            'The successful updates were: {0} '
    -            '{1}'.format(os.linesep, json.dumps(successfully_updated_changes, indent=4)))
    +        # TODO: if the successful has _STUB, the logging fails because it can't serialize
the object
    --- End diff --
    
    open jira


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message