コード例 #1
0
 def _check_ug(self):
     (user, group) = self._get_apache_user_group()
     if not sh.user_exists(user):
         msg = "No user named %r exists on this system!" % (user)
         raise excp.ConfigException(msg)
     if not sh.group_exists(group):
         msg = "No group named %r exists on this system!" % (group)
         raise excp.ConfigException(msg)
     if user in BAD_APACHE_USERS:
         msg = ("You may want to adjust your configuration, "
                 "(user=%s, group=%s) will not work with apache!"
                 % (user, group))
         raise excp.ConfigException(msg)
コード例 #2
0
ファイル: horizon.py プロジェクト: apugachev-gd/anvil
 def _check_ug(self):
     (user, group) = self._get_apache_user_group()
     if not sh.user_exists(user):
         msg = "No user named %r exists on this system!" % (user)
         raise excp.ConfigException(msg)
     if not sh.group_exists(group):
         msg = "No group named %r exists on this system!" % (group)
         raise excp.ConfigException(msg)
     if user in BAD_APACHE_USERS:
         msg = ("You may want to adjust your configuration, "
                "(user=%s, group=%s) will not work with apache!" %
                (user, group))
         raise excp.ConfigException(msg)
コード例 #3
0
ファイル: rhel.py プロジェクト: apugachev-gd/anvil
 def configure(self):
     configs_made = nova.NovaInstaller.configure(self)
     driver_canon = utils.canon_virt_driver(self.get_option('virt_driver'))
     if driver_canon == 'libvirt':
         # Create a libvirtd user group
         if not sh.group_exists('libvirtd'):
             cmd = ['groupadd', 'libvirtd']
             sh.execute(cmd)
         if not sh.isfile(LIBVIRT_POLICY_FN):
             contents = self._get_policy(self._get_policy_users())
             sh.mkdirslist(sh.dirname(LIBVIRT_POLICY_FN))
             sh.write_file(LIBVIRT_POLICY_FN, contents)
             configs_made += 1
     return configs_made
コード例 #4
0
ファイル: rhel.py プロジェクト: apugachev-gd/anvil
 def configure(self):
     configs_made = nova.NovaInstaller.configure(self)
     driver_canon = utils.canon_virt_driver(self.get_option('virt_driver'))
     if driver_canon == 'libvirt':
         # Create a libvirtd user group
         if not sh.group_exists('libvirtd'):
             cmd = ['groupadd', 'libvirtd']
             sh.execute(cmd)
         if not sh.isfile(LIBVIRT_POLICY_FN):
             contents = self._get_policy(self._get_policy_users())
             sh.mkdirslist(sh.dirname(LIBVIRT_POLICY_FN))
             sh.write_file(LIBVIRT_POLICY_FN, contents)
             configs_made += 1
     return configs_made