def provider_machine_update_hook(new_machine, provider_uuid, identifier): """ RULES: #1. READ operations ONLY! #2. FROM Cloud --> ProviderMachine ONLY! """ from service.openstack import glance_update_machine provider = Provider.objects.get(uuid=provider_uuid) if provider.get_type_name().lower() == 'openstack': glance_update_machine(new_machine) else: logger.warn("machine data for %s is likely incomplete. Create a new hook for %s." % provider)
def provider_machine_update_hook(new_machine, provider_uuid, identifier): """ RULES: #1. READ operations ONLY! #2. FROM Cloud --> ProviderMachine ONLY! """ from service.openstack import glance_update_machine provider = Provider.objects.get(uuid=provider_uuid) if provider.get_type_name().lower() == 'openstack': glance_update_machine(new_machine) else: logger.warn("machine data for %s is likely incomplete." " Create a new hook for %s." % provider)