Skip to content
Snippets Groups Projects
Commit 7caddcb7 authored by Robert Latta's avatar Robert Latta
Browse files

alligned properties with NavigationProperty names; removed unused lines

parent bbd70cfe
No related branches found
No related tags found
No related merge requests found
...@@ -30,15 +30,15 @@ def lookup_lg_routers(ds): ...@@ -30,15 +30,15 @@ def lookup_lg_routers(ds):
return True return True
site_nav_props = [ site_nav_props = [
ims.SITE_PROPERTIES['aliases'], ims.SITE_PROPERTIES['SiteAliases'],
ims.SITE_PROPERTIES['city'], ims.SITE_PROPERTIES['City'],
ims.SITE_PROPERTIES['country'] ims.SITE_PROPERTIES['Country']
] ]
eq_definitions = ds.get_filtered_entities( eq_definitions = ds.get_filtered_entities(
'EquipmentDefinition', 'EquipmentDefinition',
'Name like mx', 'Name like mx',
ims.EQUIP_DEF_PROPERTIES['nodes']) ims.EQUIP_DEF_PROPERTIES['Nodes'])
for eq_def in eq_definitions: for eq_def in eq_definitions:
nodes = eq_def['Nodes'] nodes = eq_def['Nodes']
...@@ -172,8 +172,6 @@ def otrs_get_customer_contacts(ds): ...@@ -172,8 +172,6 @@ def otrs_get_customer_contacts(ds):
'city': '', 'city': '',
'country': '', 'country': '',
'comments': '', 'comments': '',
# 'type_0': 'customer',
# 'type': customer['CustomerType']['Name']
}) })
if not _is_valid_customer(t_customer_user): if not _is_valid_customer(t_customer_user):
continue continue
...@@ -212,8 +210,6 @@ def otrs_get_vendor_contacts(ds): ...@@ -212,8 +210,6 @@ def otrs_get_vendor_contacts(ds):
'city': '', 'city': '',
'country': '', 'country': '',
'comments': '', 'comments': '',
# 'type_0': 'vendor',
# 'type': ''
}) })
if not _is_valid_customer(t_customer_user): if not _is_valid_customer(t_customer_user):
continue continue
...@@ -228,9 +224,6 @@ def otrs_get_customer_users_rows(ds): ...@@ -228,9 +224,6 @@ def otrs_get_customer_users_rows(ds):
yield ['email', 'username', 'customer_id', 'customer_id_2', 'title', yield ['email', 'username', 'customer_id', 'customer_id_2', 'title',
'firstname', 'lastname', 'phone', 'fax', 'mobile', 'street', 'zip', 'firstname', 'lastname', 'phone', 'fax', 'mobile', 'street', 'zip',
'city', 'country', 'comments'] 'city', 'country', 'comments']
# yield ['email', 'username', 'customer_id', 'customer_id_2', 'title',
# 'firstname', 'lastname', 'phone', 'fax', 'mobile', 'street', 'zip',
# 'city', 'country', 'comments', 'type', 'type_2']
def get_all_cus_user_rows(): def get_all_cus_user_rows():
yield from otrs_get_customer_contacts(ds) yield from otrs_get_customer_contacts(ds)
...@@ -240,56 +233,3 @@ def otrs_get_customer_users_rows(ds): ...@@ -240,56 +233,3 @@ def otrs_get_customer_users_rows(ds):
# this will be used to prioritisation # this will be used to prioritisation
for cu in sorted_cus: for cu in sorted_cus:
yield list(cu.values()) yield list(cu.values())
if __name__ == '__main__':
import sys
username = sys.argv[1]
password = sys.argv[2]
ds = IMS('http://83.97.94.128:81/api', username, password)
equipment_names = [
'mx1.ams.nl',
'mx1.ath2.gr',
'mx1.buc.ro',
'mx1.bud.hu',
'mx1.dub.ie',
'mx1.dub2.ie',
'mx1.fra.de',
'mx1.gen.ch',
'mx1.ham.de',
'mx1.kau.lt',
'mx1.lis.pt',
'mx1.lon.uk',
'mx1.lon2.uk',
'mx1.mad.es',
'mx1.mar.fr',
'mx1.mil2.it',
'mx1.par.fr',
'mx1.poz.pl',
'mx1.pra.cz',
'mx1.sof.bg',
'mx1.tal.ee',
'mx1.vie.at',
'mx2.ath.gr',
'mx2.bra.sk',
'mx2.bru.be',
'mx2.kau.lt',
'mx2.lis.pt',
'mx2.lju.si',
'mx2.rig.lv',
'mx2.tal.ee',
'mx2.zag.hr',
'qfx.fra.de',
'qfx.lon2.uk',
'qfx.par.fr'
]
for equipment in equipment_names:
r = lookup_pop_info(ds, equipment)
print(r)
print('--------------------')
print('--------------------')
for r in lookup_lg_routers(ds):
print(r)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment