Commit 74659dde authored by Jason Frisvold's avatar Jason Frisvold
Browse files

- Was using the wrong address for the target, fixed this and added cidr notation as well

parent 41708354
......@@ -227,7 +227,7 @@ def connect_server(server_ip, username, key_type, ssh_key):
def build_configs(dbhandle, server_id):
logger.info('Building server configuration')
sql = '''SELECT ti.id, c.server_ip, s.options, s.override, t.address,
sql = '''SELECT ti.id, s.options, s.override, t.address, t.cidr,
ti.hour, ti.minute, ti.day, ti.month, c.disabled,
s.disabled, t.disabled, ti.disabled FROM timers AS ti, cloud AS c,
spawn AS s, target AS t WHERE c.id = ti.cloud_id AND s.id =
......@@ -249,9 +249,10 @@ def build_configs(dbhandle, server_id):
for row in rows:
logger.debug('Database Retrieval : {0}'.format(str(row)))
disabled = row[9] + row[10] + row[11] + row[12]
configlist.append({ 'id' : row[0], 'ip' : str(IPAddress(row[1])),
'options' : row[2], 'override' : row[3],
'address' : row[4], 'hour' : row[5],
configlist.append({ 'id' : row[0], 'options' : row[1],
'override' : row[2],
'address' : str(IPAddress(row[3])),
'cidr' : str(row[4]), 'hour' : row[5],
'minute' : row[6], 'day' : row[7],
'month' : row[8], 'disabled' : disabled})
......@@ -272,7 +273,7 @@ def push_configs(server_conn, configlist, config_path):
tmpfile.write(config['day'] + "\n")
tmpfile.write(config['month'] + "\n")
tmpfile.write(str(config['override']) + "\n")
tmpfile.write(config['ip'] + "\n")
tmpfile.write(config['address'] + "/" + config['cidr'] + "\n")
tmpfile.write(config['options'] + "\n")
tmpfile.close()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment