def freeze_instance_task(identity_id, instance_id, **celery_task_args): identity = Identity.objects.get(id=identity_id) driver = get_esh_driver(identity) kwargs = {} private_key = "/opt/dev/atmosphere/extras/ssh/id_rsa" kwargs.update({'ssh_key': private_key}) kwargs.update({'timeout': 120}) si_script = sync_instance() kwargs.update({'deploy': si_script}) instance = driver.get_instance(instance_id) driver.deploy_to(instance, **kwargs) fi_script = freeze_instance() kwargs.update({'deploy': fi_script}) driver.deploy_to(instance, **kwargs)
def freeze_instance_task(identity_id, instance_id): from api import get_esh_driver identity = Identity.objects.get(id=identity_id) driver = get_esh_driver(identity) kwargs = {} private_key = "/opt/dev/atmosphere/extras/ssh/id_rsa" kwargs.update({"ssh_key": private_key}) kwargs.update({"timeout": 120}) si_script = sync_instance() kwargs.update({"deploy": si_script}) instance = driver.get_instance(instance_id) driver.deploy_to(instance, **kwargs) fi_script = freeze_instance() kwargs.update({"deploy": fi_script}) deploy_to.delay(driver.__class__, driver.provider, driver.identity, instance.id, **kwargs)