-
Notifications
You must be signed in to change notification settings - Fork 7
/
node_create.py
35 lines (33 loc) · 1.11 KB
/
node_create.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
This module controls the creation of objects from the database.
"""
import initialize
from lib.objects.basenode import BaseNode
def node_create(match_node,node_object):
for index in initialize.element:
node = BaseNode(
node_object[index]['created_at'],
node_object[index]['created_by'],
node_object[index]['domain_name'],
node_object[index]['hardware_vendor'],
node_object[index]['lifecycle_status'],
node_object[index]['location_name'],
node_object[index]['mgmt_ip4'],
node_object[index]['mgmt_con_ip4'],
node_object[index]['mgmt_oob_ip4'],
node_object[index]['mgmt_snmp_community4'],
node_object[index]['name'],
node_object[index]['platform_name'],
node_object[index]['oncall_team'],
node_object[index]['opersys'],
node_object[index]['role_name'],
node_object[index]['serial_num'],
node_object[index]['software_image'],
node_object[index]['software_version'],
node_object[index]['status'],
node_object[index]['type'],
node_object[index]['updated_at'],
node_object[index]['updated_by']
)
initialize.ntw_device.append(node)
return None