Lab1 EMC Python: Location

def main():

sysName = emc_vars[‘deviceName’]

if sysName == ‘VSP-1’:
location = ‘Castle of Aarrgh’
elif sysName == ‘VSP-2’:
location = ‘Bridge of Death’
elif sysName == ‘XOS-1’:
location = ‘Castle Anthrax’
elif sysName == ‘XOS-2’:
location = ‘Swamp Castle’
raise RuntimeError(“Unexpected switch!!”)

familyType = emc_vars[‘family’]

if familyType == ‘VSP Series’:
emc_cli.send(‘config term’)
cmd = ‘snmp-server location “‘+location+'”‘
elif familyType == ‘Summit Series’:
cmd = ‘configure snmp sysLocation “‘+location+'”‘
raise RuntimeError(“Unexpected switch family type!!”)


print “Successfully set switch location to:”, location


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s