def setup_virtual_machine(self, sctx): # get context from super context ctx = sctx.job_ctxs[sctx.current_job_index] adapter = VirtualMachineAdapter(ctx.subscription_id, ctx.pem_url, host=ctx.management_host) if adapter.deployment_exists(ctx.cloud_service_name, ctx.deployment_slot): # TODO: need to store the deployment info into db? self.__setup_virtual_machine_with_deployment_existed(sctx) else: self.__setup_virtual_machine_without_deployment_existed(sctx)