コード例 #1
0
 def get_services(self):
     services = []
     self_services = self.services.split(',')
     for s in self_services:
         s = s.strip()  
         services.append(s)
     return services
コード例 #2
0
 def remove_service(self, service):
     services = []
     self_services = self.services.split(',')
     for s in self_services:
         s = s.strip()  
         if s == service:
             continue
         else:
             services.append(service)
     self.services = string.join(services, ',')
コード例 #3
0
ファイル: generate_sssd_conf.py プロジェクト: jceel/freenas
 def add_service(self, service):
     if not service in ('nss', 'pam', 'sudo', 'ssh'):
         return
     if not self.services:
         self.services = service
     else:
         services = []
         self_services = self.services.split(',')
         for s in self_services:
             s = s.strip()
             services.append(s)
             if s == service:
                 return
         services.append(service)
         self.services = string.join(services, ',')
コード例 #4
0
 def add_service(self, service):
     if not service in ('nss', 'pam', 'sudo', 'ssh'):
         return
     if not self.services:
         self.service = service
     else:
         services = []
         self_services = self.services.split(',')
         for s in self_services:
             s = s.strip()  
             services.append(s)
             if s == service:
                 return
         services.append(service)
         self.services = string.join(services, ',')
コード例 #5
0
 def add_service(self, service):
     if not service in self.section_types():
         return
     if not self.services:
         self.services = service
     else:
         services = []
         self_services = self.services.split(',')
         for s in self_services:
             s = s.strip()  
             services.append(s)
             if s == service:
                 return
         services.append(service)
         self.services = string.join(services, ',')
コード例 #6
0
    def merge_config(self, sc):
        services = self.sections['sssd'].get_services()

        for s in sc.sections:
            st = s.get_section_type()
            self_s = self.sections[st]

            if st.startswith('domain') and self_s and not sc.domain_override:
                for var in s: 
                    self_s[var] = s[var]
            else:
                self.sections[st] = s

            if st not in services:
                services.append(st)

        for s in services:
            self.sections['sssd'].add_service(s)