Browse Source

added gpg key add manually

bugfixes
harshadyeola 10 years ago
parent
commit
204e0f4e1b
  1. 5
      ee/cli/plugins/stack.py
  2. 15
      ee/core/apt_repo.py

5
ee/cli/plugins/stack.py

@ -56,6 +56,9 @@ class EEStackController(CementBaseController):
EEShellExec.cmd_exec("echo \"postfix postfix/mailname string "
"$(hostname -f)\" | debconf-set-selections")
if "mysql" in apt_packages:
EERepo.add(repo_url="deb http://repo.percona.com/apt "
+ EEVariables.ee_platform_codename + " main")
EERepo.add_key('hkp://keys.gnupg.net', '1C4CBDCDCD2EFD2A ')
chars = ''.join(random.sample(string.letters, 8))
EEShellExec.cmd_exec("echo \"percona-server-server-5.6 "
"percona-server-server/root_password "
@ -89,7 +92,7 @@ class EEStackController(CementBaseController):
# Custom Nginx configuration by EasyEngine
data = dict(version='EasyEngine 3.0.1')
ee_nginx = open('/etc/nginx/conf.d/ee-nginx.conf','w')
ee_nginx = open('/etc/nginx/conf.d/ee-nginx.conf', 'w')
ee_nginx.write(self.app.render((data), 'nginx-core.mustache'))
ee_nginx.close()

15
ee/core/apt_repo.py

@ -1,5 +1,6 @@
import os.path
import gnupg
from ee.core.shellexec import EEShellExec
from ee.core.variables import EEVariables
@ -28,12 +29,12 @@ class EERepo():
print("{error}".format(error=e))
return False
if ppa is not None:
if EEVariables.ee_platform_distro is not 'Ubuntu':
EEShellExec.cmd_exec("add-apt-repository -y {ppa_name}"
.format(ppa_name=ppa))
else:
if EEVariables.ee_platform_distro == 'squeeze':
print("Cannot add repo for {distro}"
.format(distro=EEVariables.ee_platform_distro))
else:
EEShellExec.cmd_exec("add-apt-repository -y {ppa_name}"
.format(ppa_name=ppa))
def remove(repo_url=None):
# TODO remove repository
@ -41,5 +42,11 @@ class EERepo():
"--remove '{ppa_name}'".format(ppa_name=repo_url))
pass
def add_key(keyserver, keyids):
EEShellExec.cmd_exec("gpg --keyserver {0}".format(keyserver)
"--recv-keys {0}".format(keyids))
EEShellExec.cmd_exec("gpg -a --export --armor {0}".format(keyids)
"| apt-key add - ")
# if __name__ == '__main__':
# EERepo().add(repo_url="http://ds.asf", codename="trusty", repo_type="main")

Loading…
Cancel
Save