Exemplo n.º 1
0
def purge_service():
    flow = graph_flow.Flow('Purging poppy-service').add(
        purge_service_tasks.PurgeProviderServicesTask(),
        linear_flow.Flow('Purge provider details').add(
            common.UpdateProviderDetailErrorTask(rebind=['responders'])),
        common.UpdateProviderDetailIfNotEmptyTask(
            rebind=['changed_provider_details_dict']))
    return flow
Exemplo n.º 2
0
 def mock_purge_service(self, mock_bootstrap, hard=False):
     mock_bootstrap.return_value = self.bootstrap_obj
     purge_provider = purge_service_tasks.PurgeProviderServicesTask()
     provider_details = json.dumps(
         dict([(k, v.to_dict()) for k, v in self.provider_details.items()]))
     responders = \
         purge_provider.execute(json.dumps(self.service_obj.to_dict()),
                                json.dumps(hard),
                                provider_details,
                                str(None))
     error_update = common.UpdateProviderDetailErrorTask()
     changed_provider_details_dict = error_update.execute(
         responders, self.service_id, provider_details, hard)
     not_empty_update = common.UpdateProviderDetailIfNotEmptyTask()
     not_empty_update.execute(changed_provider_details_dict,
                              self.project_id, self.service_id)