Add model context manager (#128)
[osm/N2VC.git] / juju / machine.py
index 44560bf..b06d54b 100644 (file)
@@ -13,8 +13,7 @@ class Machine(model.ModelEntity):
         Blocks until the machine is actually removed.
 
         """
-        facade = client.ClientFacade()
-        facade.connect(self.connection)
+        facade = client.ClientFacade.from_connection(self.connection)
 
         log.debug(
             'Destroying machine %s', self.id)
@@ -31,7 +30,7 @@ class Machine(model.ModelEntity):
         :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.
@@ -42,8 +41,8 @@ class Machine(model.ModelEntity):
         """
         log.debug('Updating annotations on machine %s', self.id)
 
-        self.ann_facade = client.AnnotationsFacade()
-        self.ann_facade.connect(self.connection)
+        self.ann_facade = client.AnnotationsFacade.from_connection(
+            self.connection)
 
         ann = client.EntityAnnotations(
             entity=self.id,
@@ -64,7 +63,7 @@ class Machine(model.ModelEntity):
         :param str scp_opts: Additional options to the `scp` command
 
         """
-        pass
+        raise NotImplementedError()
 
     def ssh(
             self, command, user=None, proxy=False, ssh_opts=None):
@@ -76,7 +75,7 @@ class Machine(model.ModelEntity):
         :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.
@@ -85,4 +84,4 @@ class Machine(model.ModelEntity):
         :param bool utc: Display time as UTC in RFC3339 format
 
         """
-        pass
+        raise NotImplementedError()