Exemplo n.º 1
0
 def _get_instance(self, strict=False):
     conn = self.conn
     i = util.get_instance_by_name(self.NAME, conn)
     if strict and i is None:
         err = "Could not acquire instance! Is the name '{0}' correct?"
         err = err.format(self.NAME)
         self.report(err)
         raise SystemExit(1)
     return i
Exemplo n.º 2
0
 def _get_instance(self, strict=False):
     conn = self.conn
     i = util.get_instance_by_name(self.NAME, conn)
     if strict and i is None:
         err = "Could not acquire instance! Is the name '{0}' correct?"
         err = err.format(self.NAME)
         self.report(err)
         raise SystemExit(1)
     return i
Exemplo n.º 3
0
 def _status(self):
     """ retrieves service status information.
         use this instead of self.status() if you want to quietly
         retrieve information for use without actually displaying it
     """
     instance = util.get_instance_by_name(self.NAME, self.conn)
     result = dict(
         instanceance=None, ip=None,
         private_ip=None, tags=[],
         status='terminated?',)
     if instance:
         result.update(
             dict(
                 instance=instance,
                 tags=instance.tags,
                 status=instance.update(),
                 ip=instance.ip_address,
                 private_ip=instance.private_ip_address,
             ))
     return result
Exemplo n.º 4
0
 def _status(self):
     """ retrieves service status information.
         use this instead of self.status() if you want to quietly
         retrieve information for use without actually displaying it
     """
     instance = util.get_instance_by_name(self.NAME, self.conn)
     result = dict(
         instanceance=None,
         ip=None,
         private_ip=None,
         tags=[],
         status='terminated?',
     )
     if instance:
         result.update(
             dict(
                 instance=instance,
                 tags=instance.tags,
                 status=instance.update(),
                 ip=instance.ip_address,
                 private_ip=instance.private_ip_address,
             ))
     return result