projects
/
osm
/
N2VC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #82 from juju/feature/examples-use-loop
[osm/N2VC.git]
/
juju
/
machine.py
diff --git
a/juju/machine.py
b/juju/machine.py
index
5eac6c2
..
c8bdcd4
100644
(file)
--- a/
juju/machine.py
+++ b/
juju/machine.py
@@
-10,6
+10,8
@@
class Machine(model.ModelEntity):
async def destroy(self, force=False):
"""Remove this machine from the model.
async def destroy(self, force=False):
"""Remove this machine from the model.
+ Blocks until the machine is actually removed.
+
"""
facade = client.ClientFacade()
facade.connect(self.connection)
"""
facade = client.ClientFacade()
facade.connect(self.connection)
@@
-17,7
+19,9
@@
class Machine(model.ModelEntity):
log.debug(
'Destroying machine %s', self.id)
log.debug(
'Destroying machine %s', self.id)
- return await facade.DestroyMachines(force, [self.id])
+ await facade.DestroyMachines(force, [self.id])
+ return await self.model._wait(
+ 'machine', self.id, 'remove')
remove = destroy
def run(self, command, timeout=None):
remove = destroy
def run(self, command, timeout=None):
@@
-27,7
+31,7
@@
class Machine(model.ModelEntity):
:param int timeout: Time to wait before command is considered failed
"""
:param int timeout: Time to wait before command is considered failed
"""
- pass
+ raise NotImplementedError()
async def set_annotations(self, annotations):
"""Set annotations on this machine.
async def set_annotations(self, annotations):
"""Set annotations on this machine.
@@
-39,7
+43,7
@@
class Machine(model.ModelEntity):
log.debug('Updating annotations on machine %s', self.id)
self.ann_facade = client.AnnotationsFacade()
log.debug('Updating annotations on machine %s', self.id)
self.ann_facade = client.AnnotationsFacade()
- self.ann_facade.connect(
model
.connection)
+ self.ann_facade.connect(
self
.connection)
ann = client.EntityAnnotations(
entity=self.id,
ann = client.EntityAnnotations(
entity=self.id,
@@
-60,7
+64,7
@@
class Machine(model.ModelEntity):
:param str scp_opts: Additional options to the `scp` command
"""
:param str scp_opts: Additional options to the `scp` command
"""
- pass
+ raise NotImplementedError()
def ssh(
self, command, user=None, proxy=False, ssh_opts=None):
def ssh(
self, command, user=None, proxy=False, ssh_opts=None):
@@
-72,7
+76,7
@@
class Machine(model.ModelEntity):
:param str ssh_opts: Additional options to the `ssh` command
"""
:param str ssh_opts: Additional options to the `ssh` command
"""
- pass
+ raise NotImplementedError()
def status_history(self, num=20, utc=False):
"""Get status history for this machine.
def status_history(self, num=20, utc=False):
"""Get status history for this machine.
@@
-81,4
+85,4
@@
class Machine(model.ModelEntity):
:param bool utc: Display time as UTC in RFC3339 format
"""
:param bool utc: Display time as UTC in RFC3339 format
"""
- pass
+ raise NotImplementedError()