diff --git a/ee/core/apt-repo.py b/ee/core/apt-repo.py new file mode 100644 index 00000000..eae22a2d --- /dev/null +++ b/ee/core/apt-repo.py @@ -0,0 +1,29 @@ + +from ee.core.variables import EEVariables + + +class EERepo(): + """Manage Repositories""" + + def __init__(self): + """Initialize """ + pass + + def add(self, repo_url=None, codename=None, repo_type=None, ppa=None): + # TODO add repository code + repo_file_path = ("/etc/apt/sources.list.d/" + + EEVariables().ee_repo_file) + try: + with open(repo_file_path, "a") as repofile: + repofile.write("\n" + repo_url + " " + codename + + " " + repo_type) + repofile.close() + except Exception as e: + raise + + def remove(self, repo_url=None, codename=None, repo_type=None, ppa=None): + # TODO remove repository + pass + +# if __name__ == '__main__': +# EERepo().add(repo_url="http://ds.asf", codename="trusty", repo_type="main") diff --git a/ee/core/swapcreation.py b/ee/core/swapcreation.py index 822b36ce..ea26542e 100644 --- a/ee/core/swapcreation.py +++ b/ee/core/swapcreation.py @@ -1,6 +1,7 @@ """EasyEngine swap creation module.""" -Class EESwapCreation(): + +class EESwapCreation(): """Generice swap creation intialisation""" def __init__(): # TODO method for swap creation diff --git a/ee/core/variables.py b/ee/core/variables.py index 020927c4..6fb3160f 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -5,7 +5,6 @@ class EEVariables(): """Intialization of core variables""" # EasyEngine core variables - ee_version = "3.0.0" # EasyEngine stack installation varibales # Nginx repo and packages @@ -24,3 +23,9 @@ class EEVariables(): # Postfix repo and packages ee_postfix_repo = "" ee_postfix = ["postfix"] + + # Repo + ee_repo_file = "ee-repo.list" + + def __init__(self): + pass