def detach(ctx, name): try: restore_session(ctx) platform = Platform(ctx.obj['client']) stdout(platform.detach_vcenter(vc_name=name), ctx) except Exception as e: stderr(e, ctx)
def detach(ctx, name): try: restore_session(ctx) platform = Platform(ctx.obj['client']) stdout(platform.detach_vcenter(vc_name=name), ctx) except Exception as e: stderr(e, ctx)
def test_0060_detach_vc_while_still_enabled(self): """Platform.detach_vcenter while VC is enabled should fail. Wait for async command to complete before checking result. """ platform = Platform(TestVC._client) try: task = platform.detach_vcenter(vc_name=TestVC._vcServerName) TestVC._client.get_task_monitor().wait_for_success(task=task) self.fail('Should not be able to detach VC that is enabled ' + TestVC._vcServerName) except InvalidStateException as e: return
def test_0060_detach_vc_while_still_enabled(self): """Platform.detach_vcenter while VC is enabled should fail. Wait for async command to complete before checking result. """ platform = Platform(TestVC._client) try: task = platform.detach_vcenter(vc_name=TestVC._vcServerName) TestVC._client.get_task_monitor().wait_for_success(task=task) self.fail('Should not be able to detach VC that is enabled ' + TestVC._vcServerName) except InvalidStateException as e: return
def test_0080_detach_vc(self): """Platform.detach_vcenter unregisters (detaches) a vcenter. Wait for async command to complete before checking result. """ platform = Platform(TestVC._client) task = platform.detach_vcenter(vc_name=TestVC._vcServerName) TestVC._client.get_task_monitor().wait_for_success(task=task) try: platform.get_vcenter(name=TestVC._vcServerName) self.fail('Should not be able to find detached VC ' + TestVC._vcServerName) except EntityNotFoundException as e: return
def test_0080_detach_vc(self): """Platform.detach_vcenter unregisters (detaches) a vcenter. Wait for async command to complete before checking result. """ platform = Platform(TestVC._client) task = platform.detach_vcenter(vc_name=TestVC._vcServerName) TestVC._client.get_task_monitor().wait_for_success(task=task) try: platform.get_vcenter(name=TestVC._vcServerName) self.fail('Should not be able to find detached VC ' + TestVC._vcServerName) except EntityNotFoundException as e: return