MCPcopy Create free account
hub / github.com/apache/cloudstack / device_exist

Function device_exist

python/lib/cloud_utils.py:412–423  ·  view source on GitHub ↗
(devName)

Source from the content-addressed store, hash-verified

410# this configures the agent
411
412def device_exist(devName):
413 try:
414 alreadysetup = False
415 if distro in (Fedora,CentOS, RHEL6):
416 alreadysetup = augtool._print("/files/etc/sysconfig/network-scripts/ifcfg-%s"%devName).stdout.strip()
417 elif distro == SUSE:
418 alreadysetup = augtool._print("/files/etc/sysconfig/network/ifcfg-%s"%devName).stdout.strip()
419 elif distro == Ubuntu:
420 alreadysetup = augtool.match("/files/etc/network/interfaces/iface",devName).stdout.strip()
421 return alreadysetup
422 except OSError as e:
423 return False
424
425def setup_agent_config(configfile, host, zone, pod, cluster, guid, pubNic, prvNic):
426 stderr("Examining Agent configuration")

Callers 1

setup_agent_configFunction · 0.85

Calls 1

matchMethod · 0.45

Tested by

no test coverage detected