MCPcopy Create free account
hub / github.com/apache/cloudstack / maybeUp

Method maybeUp

test/systemvm/__init__.py:87–100  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

85 self._sshHostConfig = None
86
87 def maybeUp(self):
88 if not self._controlVagrant:
89 return
90 state = self._vagrant.status(vm_name=self.host)[0].state
91 if state == Vagrant.NOT_CREATED:
92 self._vagrant.up(vm_name=self.host)
93 self._startedVagrant = True
94 elif state in [Vagrant.POWEROFF, Vagrant.SAVED, Vagrant.ABORTED]:
95 raise Exception(
96 "SystemVM testing does not support resume(), do not use vagrant suspend/halt")
97 elif state == Vagrant.RUNNING:
98 self._startedVagrant = False
99 else:
100 raise Exception("Unrecognized vagrant state %s" % state)
101
102 def maybeDestroy(self):
103 if not self._controlVagrant or not self._startedVagrant:

Callers 1

setUpClassMethod · 0.80

Calls 1

statusMethod · 0.45

Tested by

no test coverage detected