Exemplo n.º 1
0
    def __init__(self, search_result):
        self.search_result = search_result;
        self.dn = search_result.get_dn()
        self.name = search_result.get_attr_values('dlmName')[0]

        if search_result.has_attribute('dlmDescription'):
            self.desc = search_result.get_attr_values('dlmDescription')[0]
        else:
            self.desc = ''

        self.settings = search_result.get_attr_values('dlmSettingContextSettingRef')
        
        if search_result.has_attribute('symcElementConfigurationElementRef'):
            self.elements_names = []
            self.elements = []
            refs = search_result.get_attr_values('symcElementConfigurationElementRef')
            for ref in refs:
                self.elements += [ref]
                dlmName = re.match('dlmName=(.+?),.+', ref)
                self.elements_names += [dlmName.group(1)]
        else:
            self.elements_names = [];
            self.elements = [];

        if  search_result.has_attribute('symcSequenceRevision'):
            self.updated_at = search_result.get_attr_values('symcSequenceRevision')[0]
            self.updated_at = ldaphelper.parse_generalized_time(self.updated_at)
        else:
            self.updated_at = datetime.now()
Exemplo n.º 2
0
    def __init__(self, search_result):
        self.dn = search_result.get_dn()
        self.name = search_result.get_attr_values('dlmCaption')[0]
        if search_result.has_attribute('binProperty'):
            self.data = search_result.get_attr_values('binProperty')[0]
        else:
            self.data = ''

        if search_result.has_attribute('binPropertyType'):
            self.data_type = search_result.get_attr_values('binPropertyType')[0]
        else:
            self.data_type = None

        if search_result.has_attribute('dlmDescription'):
            self.desc = search_result.get_attr_values('dlmDescription')[0]
        else:
            self.desc = ''
        self.settingID = search_result.get_attr_values('dlmSettingID')[0]
        self.metadata = search_result.get_attr_values('symcMetaData')[0]

        self.updated_at = search_result.get_attr_values('symcSequenceRevision')[0]
        self.updated_at = ldaphelper.parse_generalized_time(self.updated_at)

        self.is_valid = search_result.get_attr_values('symcValid')[0]
        if 'TRUE' == self.is_valid:
            self.is_valid = True
        else:
            self.is_valid = False
Exemplo n.º 3
0
 def __init__(self, search_result):
     self.dn = search_result.dn
     self.host = search_result.get_attr_values('host')[0]
     self.addresses = search_result.get_attr_values('symcIPAddresses')
     self.address = self.addresses[0]
     self.dn = search_result.get_dn()
     self.name = search_result.get_attr_values('dlmCaption')[0]
     #parse datetime
     self.install_date = search_result.get_attr_values('dlmInstallDate')[0]
     self.install_date = ldaphelper.parse_generalized_time(self.install_date)
Exemplo n.º 4
0
    def __init__(self, search_result):
        self.dn = search_result.get_dn()
        self.id = search_result.get_attr_values('dlmSettingID')[0]
        self.name = search_result.get_attr_values('dlmCaption')[0]
        self.orderedCimKeys = search_result.get_attr_values('orderedCimKeys')[0]

        if  search_result.has_attribute('binProperty'):
            self.bin_property = search_result.get_attr_values('binProperty')[0]

        if  search_result.has_attribute('symcSequenceRevision'):
            self.updated_at = search_result.get_attr_values('symcSequenceRevision')[0]
            self.updated_at = ldaphelper.parse_generalized_time(self.updated_at)
        else:
            self.updated_at = datetime.now()