Browse Source

add repo

bugfixes
harshadyeola 10 years ago
parent
commit
0619d5fb0a
  1. 29
      ee/core/apt-repo.py
  2. 3
      ee/core/swapcreation.py
  3. 7
      ee/core/variables.py

29
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")

3
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

7
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

Loading…
Cancel
Save