コード例 #1
0
 def __init__(self,
              entities_yml_file=config.cfg.entities_yml_file,
              *args,
              **kwargs):
     self.entities_yml_file = entities_yml_file
     self.entities = util.read_data_file(self.entities_yml_file)
     self.users = util.myDict(self.getUsers())
     self.devices = util.myDict(self.getDevices())
     self.ssh_devices = self.getSSHDevices()
コード例 #2
0
ファイル: oids.py プロジェクト: jbutler42/pynet_class
def oid_by_name(name=None, oids_yml_file=config.cfg.oids_yml_file):
    """Given an OID name, return the OID string and the oids_dict in a tuple.

    Parameter:: name
    Parameter_type:: string
    Return:: return_val
    Return_type:: tuple (string, dict)

    Prints an error to stdout if 'name' paramter does not match a key
    in oids_dict.
    """

    oids_dict = util.read_data_file(oids_yml_file)

    return_val = oids_dict.get(name)
    if return_val[0] == None:
        print "Error: Parameter value of parameter 'name' did not match a key in oids_dict.  'name' = ", name
        print "  Valid keys in oids_dict:"
        print "  ", oids_dict.keys()
    return return_val
コード例 #3
0
ファイル: oids.py プロジェクト: jbutler42/pynet_class
def oid_by_name(name=None, oids_yml_file=config.cfg.oids_yml_file):
    """Given an OID name, return the OID string and the oids_dict in a tuple.

    Parameter:: name
    Parameter_type:: string
    Return:: return_val
    Return_type:: tuple (string, dict)

    Prints an error to stdout if 'name' paramter does not match a key
    in oids_dict.
    """

    oids_dict = util.read_data_file(oids_yml_file)

    return_val = oids_dict.get(name)
    if return_val[0] == None:
        print "Error: Parameter value of parameter 'name' did not match a key in oids_dict.  'name' = ", name
        print "  Valid keys in oids_dict:"
        print "  ", oids_dict.keys()
    return return_val
コード例 #4
0
ファイル: entities.py プロジェクト: jbutler42/pynet_class
 def __init__(self, entities_yml_file=config.cfg.entities_yml_file, *args, **kwargs):
     self.entities_yml_file = entities_yml_file
     self.entities = util.read_data_file(self.entities_yml_file)
     self.users = util.myDict(self.getUsers())
     self.devices = util.myDict(self.getDevices())
     self.ssh_devices = self.getSSHDevices()