Explain error

parent ce0a73b4
...@@ -38,6 +38,7 @@ from supervisor import xmlrpc ...@@ -38,6 +38,7 @@ from supervisor import xmlrpc
import xmlrpclib import xmlrpclib
import pwd import pwd
import utils import utils
from slapos.slap.slap import NotFoundError
from svcbackend import getSupervisorRPC from svcbackend import getSupervisorRPC
from exception import BuildoutFailedError, WrongPermissionError, \ from exception import BuildoutFailedError, WrongPermissionError, \
PathDoesNotExistError PathDoesNotExistError
...@@ -259,7 +260,11 @@ class Partition(object): ...@@ -259,7 +260,11 @@ class Partition(object):
not os.path.exists(self.cert_file): not os.path.exists(self.cert_file):
self.logger.info('Certificate and key not found, downloading to %r and ' self.logger.info('Certificate and key not found, downloading to %r and '
'%r' % (self.cert_file, self.key_file)) '%r' % (self.cert_file, self.key_file))
try:
partition_certificate = self.computer_partition.getCertificate() partition_certificate = self.computer_partition.getCertificate()
except NotFoundError:
raise NotFoundError('Partition %s is not known from SlapOS Master.' % \
self.partition_id)
open(self.key_file, 'w').write(partition_certificate['key']) open(self.key_file, 'w').write(partition_certificate['key'])
open(self.cert_file, 'w').write(partition_certificate['certificate']) open(self.cert_file, 'w').write(partition_certificate['certificate'])
for f in [self.key_file, self.cert_file]: for f in [self.key_file, self.cert_file]:
......
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