def removeApacheConf(self, domain):
    if os.path.isfile("/etc/apache2/sites-available/{0}.conf".format(domain)):
        Log.debug(self, "Removing Apache configuration")
        SSSFileUtils.rm(self, "/etc/apache2/sites-enabled/{0}.conf".format(domain))
        SSSFileUtils.rm(self, "/etc/apache2/sites-available/{0}.conf".format(domain))
        SSSService.reload_service(self, "apache2")
        SSSGit.add(self, ["/etc/apache2"], msg="Deleted {0} ".format(domain))
def removeApacheConf(self, domain):
    if os.path.isfile('/etc/apache2/sites-available/{0}.conf'.format(domain)):
        Log.debug(self, "Removing Apache configuration")
        SSSFileUtils.rm(self,
                        '/etc/apache2/sites-enabled/{0}.conf'.format(domain))
        SSSFileUtils.rm(self,
                        '/etc/apache2/sites-available/{0}.conf'.format(domain))
        SSSService.reload_service(self, 'apache2')
        SSSGit.add(self, ["/etc/apache2"], msg="Deleted {0} ".format(domain))
def deleteWebRoot(self, webroot):
    # do some preprocessing before proceeding
    webroot = webroot.strip()
    if webroot == "/var/www/" or webroot == "/var/www" or webroot == "/var/www/.." or webroot == "/var/www/.":
        Log.debug(self, "Tried to remove {0}, but didn't remove it".format(webroot))
        return False

    if os.path.isdir(webroot):
        Log.debug(self, "Removing {0}".format(webroot))
        SSSFileUtils.rm(self, webroot)
        return True
    else:
        Log.debug(self, "{0} does not exist".format(webroot))
        return False
def deleteWebRoot(self, webroot):
    # do some preprocessing before proceeding
    webroot = webroot.strip()
    if (webroot == "/var/www/" or webroot == "/var/www"
            or webroot == "/var/www/.." or webroot == "/var/www/."):
        Log.debug(self,
                  "Tried to remove {0}, but didn't remove it".format(webroot))
        return False

    if os.path.isdir(webroot):
        Log.debug(self, "Removing {0}".format(webroot))
        SSSFileUtils.rm(self, webroot)
        return True
    else:
        Log.debug(self, "{0} does not exist".format(webroot))
        return False