Ejemplo n.º 1
0
    def reload(self):
        '''
        get the ipaddress here
        '''
        if self.instance_id != None:
            try:
                ips = self.nova().floating_ips.get(self.instance_id)
                self.ipaddress = ips.ip
            except Exception as ex:
                logger.warn("Error getting floating IPs: %s" % str(ex))

        Resource.reload(self)
Ejemplo n.º 2
0
    def reload(self):
        """
        re-read the server's ipaddress so FnGetAtt works.
        """
        try:
            server = self.nova().servers.get(self.instance_id)
            for n in server.networks:
                self.ipaddress = server.networks[n][0]
        except NotFound:
            self.ipaddress = "0.0.0.0"

        Resource.reload(self)