Commit 5489c4e2 authored by Lucas Carvalho's avatar Lucas Carvalho

Removed signature_public_file and renamed signature_private_file.

Removed the argument signature_public_file because it should be inside
the software profile under networkcache-section.

And renamed signature_private_file to signature_private_key_file.
parent 3b47ba8d
...@@ -48,7 +48,7 @@ REQUIRED_COMPUTER_PARTITION_PERMISSION = '0750' ...@@ -48,7 +48,7 @@ REQUIRED_COMPUTER_PARTITION_PERMISSION = '0750'
class Software(object): class Software(object):
"""This class is responsible of installing a software release""" """This class is responsible of installing a software release"""
def __init__(self, url, software_root, console, buildout, def __init__(self, url, software_root, console, buildout,
signature_public_file, signature_private_file): signature_private_key_file):
"""Initialisation of class parameters """Initialisation of class parameters
""" """
self.url = url self.url = url
...@@ -58,8 +58,7 @@ class Software(object): ...@@ -58,8 +58,7 @@ class Software(object):
self.buildout = buildout self.buildout = buildout
self.logger = logging.getLogger('BuildoutManager') self.logger = logging.getLogger('BuildoutManager')
self.console = console self.console = console
self.signature_private_file = signature_private_file self.signature_private_key_file = signature_private_key_file
self.signature_public_file = signature_public_file
def install(self): def install(self):
""" Fetches buildout configuration from the server, run buildout with """ Fetches buildout configuration from the server, run buildout with
...@@ -82,8 +81,7 @@ class Software(object): ...@@ -82,8 +81,7 @@ class Software(object):
buildout_parameter_list = [ buildout_parameter_list = [
'buildout:extends-cache=%s' % extends_cache, 'buildout:extends-cache=%s' % extends_cache,
'buildout:directory=%s' % self.software_path, 'buildout:directory=%s' % self.software_path,
'buildout:signature_public_file=%s' % self.signature_public_file, 'buildout:signature_private_key_file=%s' % self.signature_private_key_file,
'buildout:signature_private_file=%s' % self.signature_private_file,
'-c', self.url] '-c', self.url]
bootstrapBuildout(self.software_path, self.buildout, bootstrapBuildout(self.software_path, self.buildout,
additional_buildout_parametr_list=buildout_parameter_list, additional_buildout_parametr_list=buildout_parameter_list,
......
...@@ -97,8 +97,8 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple): ...@@ -97,8 +97,8 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
parser.add_argument("--key_file", help="SSL Authorisation key file.") parser.add_argument("--key_file", help="SSL Authorisation key file.")
parser.add_argument("--cert_file", parser.add_argument("--cert_file",
help="SSL Authorisation certificate file.") help="SSL Authorisation certificate file.")
parser.add_argument("--signature_private_file", help="Private Key File.") parser.add_argument("--signature_private_key_file", default='',
parser.add_argument("--signature_public_file", help="Public Key File.") help="Signature private key file.")
parser.add_argument("--master_ca_file", help="Root certificate of SlapOS " parser.add_argument("--master_ca_file", help="Root certificate of SlapOS "
"master key.") "master key.")
parser.add_argument("--certificate_repository_path", parser.add_argument("--certificate_repository_path",
...@@ -166,11 +166,9 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple): ...@@ -166,11 +166,9 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
key_file = option_dict.get('key_file') key_file = option_dict.get('key_file')
cert_file = option_dict.get('cert_file') cert_file = option_dict.get('cert_file')
master_ca_file = option_dict.get('master_ca_file') master_ca_file = option_dict.get('master_ca_file')
signature_private_file = option_dict.get('signature_private_file', '') signature_private_key_file = option_dict.get('signature_private_key_file')
signature_public_file = option_dict.get('signature_public_file', '')
for f in [key_file, cert_file, master_ca_file, for f in [key_file, cert_file, master_ca_file, signature_private_file]:
signature_private_file, signature_public_file]:
if f not in ('', None,): if f not in ('', None,):
if not os.path.exists(f): if not os.path.exists(f):
parser.error('File %r does not exists.' % f) parser.error('File %r does not exists.' % f)
...@@ -201,8 +199,7 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple): ...@@ -201,8 +199,7 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
key_file=key_file, key_file=key_file,
cert_file=cert_file, cert_file=cert_file,
master_ca_file=master_ca_file, master_ca_file=master_ca_file,
signature_private_file=signature_private_file, signature_private_key_file=signature_private_key_file,
signature_public_file=signature_public_file,
certificate_repository_path=certificate_repository_path, certificate_repository_path=certificate_repository_path,
console=option_dict['console'], console=option_dict['console'],
buildout=option_dict.get('buildout')), buildout=option_dict.get('buildout')),
...@@ -272,8 +269,7 @@ class Slapgrid(object): ...@@ -272,8 +269,7 @@ class Slapgrid(object):
buildout, buildout,
key_file=None, key_file=None,
cert_file=None, cert_file=None,
signature_private_file=None, signature_private_key_file=None,
signature_public_file=None,
master_ca_file=None, master_ca_file=None,
certificate_repository_path=None, certificate_repository_path=None,
console=False): console=False):
...@@ -290,8 +286,7 @@ class Slapgrid(object): ...@@ -290,8 +286,7 @@ class Slapgrid(object):
self.cert_file = cert_file self.cert_file = cert_file
self.master_ca_file = master_ca_file self.master_ca_file = master_ca_file
self.certificate_repository_path = certificate_repository_path self.certificate_repository_path = certificate_repository_path
self.signature_private_file = signature_private_file self.signature_private_key_file = signature_private_key_file
self.signature_public_file = signature_public_file
# Configures logger # Configures logger
self.logger = logging.getLogger('Slapgrid') self.logger = logging.getLogger('Slapgrid')
# Creates objects from slap module # Creates objects from slap module
...@@ -364,8 +359,7 @@ class Slapgrid(object): ...@@ -364,8 +359,7 @@ class Slapgrid(object):
software_release_uri = software_release.getURI() software_release_uri = software_release.getURI()
Software(url=software_release_uri, software_root=self.software_root, Software(url=software_release_uri, software_root=self.software_root,
console=self.console, buildout=self.buildout, console=self.console, buildout=self.buildout,
signature_private_file=self.signature_private_file, signature_private_key_file=self.signature_private_key_file).install()
signature_public_file=self.signature_public_file).install()
except (SystemExit, KeyboardInterrupt): except (SystemExit, KeyboardInterrupt):
exception = traceback.format_exc() exception = traceback.format_exc()
software_release.error(exception) software_release.error(exception)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment