def _find_config_root(self): """Find the Apache Configuration Root file.""" location = ["apache2.conf", "httpd.conf", "conf/httpd.conf"] for name in location: if os.path.isfile(os.path.join(self.root, name)): return os.path.join(self.root, name) raise errors.NoInstallationError("Could not find configuration root")
def _find_config_root(self): """Find the Nginx Configuration Root file.""" location = ['nginx.conf'] for name in location: if os.path.isfile(os.path.join(self.root, name)): return os.path.join(self.root, name) raise errors.NoInstallationError("Could not find configuration root")
def check_version(self): """Check Plesk installed and version is supported""" if self.secret_key: return version = os.path.join(self.PSA_PATH, "version") if not os.path.exists(version): raise errors.NoInstallationError('Plesk is not installed') with open(version, 'r') as f: version_data = f.read() major, _ = version_data.split('.', 1) if int(major) < 12: raise errors.NotSupportedError( 'Plesk version is not supported: %s' % version_data)