Ejemplo n.º 1
0
 def test_get_zones(self):
     zones = route53.get_zones()
Ejemplo n.º 2
0
Archivo: test.py Proyecto: LucsT/Area53
 def test_get_zones(self):
     zones = route53.get_zones()
Ejemplo n.º 3
0
    actual_ip_address = match.group()
    logger.debug("Obtained IP " + actual_ip_address)

    config = ConfigParser.ConfigParser()

    config.read(basePath + "/config.ini")

    key = config.get("aws_keys", "key")
    access = config.get("aws_keys", "access")

    os.environ["AWS_ACCESS_KEY_ID"] = key
    os.environ["AWS_SECRET_ACCESS_KEY"] = access

    from area53 import route53

    """
    Iterate through all zones
    """
    zones = route53.get_zones()

    for zone in zones:
        for record in zone.get_records():
            if record.type == "A" and record.name not in blacklist:
                logger.debug(blacklist)
                logger.debug("Record type = <%s>" % record.type)
                if record.resource_records[0] != actual_ip_address:
                    logger.info("IP address different (zone %s recordset %s)" % (zone.name, record.name))
                    zone.update_a(record.name, actual_ip_address, record.ttl)
                    logger.info("Updating Record name = %s" % record.name)
                    logger.info("Updated to %s" % actual_ip_address)