def update_service(): flow = graph_flow.Flow('Updating poppy-service').add( update_service_tasks.UpdateProviderServicesTask(), linear_flow.Flow( 'Update Service DNS Mapping flow', retry=retry.ParameterizedForEach( rebind=['time_seconds'], provides='retry_sleep_time')).add( update_service_tasks.UpdateServiceDNSMappingTask( rebind=['responders'])), update_service_tasks.UpdateLogDeliveryContainerTask(), update_service_tasks.GatherProviderDetailsTask( rebind=['responders', 'dns_responder', 'log_responders']), update_service_tasks.UpdateProviderDetailsTask_Errors( rebind=['provider_details_dict_errors_tuple'])) return flow
def bootstrap_mock_update(mock_bootstrap): mock_bootstrap.return_value = self.bootstrap_obj service_old = json.dumps(self.service_json) update_provider = update_service_tasks.UpdateProviderServicesTask() service_updates = self.service_json.copy() service_updates['log_delivery'] = {'enabled': True} service_updates_json = json.dumps(service_updates) responders = update_provider.execute(service_old, service_updates_json) update_dns = update_service_tasks.UpdateServiceDNSMappingTask() dns_responder = update_dns.execute(responders, 0, service_old, service_updates_json, self.project_id, self.service_id) log_delivery_update = \ update_service_tasks.UpdateLogDeliveryContainerTask() log_responder = log_delivery_update.execute( self.project_id, self.auth_token, service_old, service_updates_json) gather_provider = update_service_tasks.GatherProviderDetailsTask() provider_details_dict = \ gather_provider.execute(responders, dns_responder, log_responder, self.project_id, self.service_id, service_old) update_provider_details = \ update_service_tasks.UpdateProviderDetailsTask_Errors() update_provider_details.execute(provider_details_dict, self.project_id, self.service_id, service_old, service_updates_json)