From 1a10b5d747a1ffd6a68bff730476ecf89bebecf6 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 9 Nov 2018 08:53:10 -0500 Subject: [PATCH] Have confluent2lxca use current config for address In a confluent2lxca scenario, it is highly probably that confluent's attribute is not viable for LXCA usage (link local address). Give the current configuration the opportunity to replace the confluent reference with the current IPv4 of the host. --- confluent_client/bin/confluent2lxca | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/confluent_client/bin/confluent2lxca b/confluent_client/bin/confluent2lxca index 44fed99a..0f8a58a5 100644 --- a/confluent_client/bin/confluent2lxca +++ b/confluent_client/bin/confluent2lxca @@ -52,6 +52,15 @@ def main(): if node not in databynode: databynode[node] = {} databynode[node].update(res['databynode'][node]) + for res in sess.read( + '/noderange/{0}/configuration/management_controller/net_interfaces/management'.format( + noderange)): + for node in res.get('databynode', {}): + currip = res['databynode'][node].get('ipv4_address', {}).get( + 'value', '') + if currip: + databynode[node]['hardwaremanagement.manager'] = { + 'value': currip.split('/', 1)[0]} with open(options.output, 'w') as importfile: bulkimport = csv.writer(importfile) bulkimport.writerow(headers)