Commit 2848030f authored by Rémi Duraffort's avatar Rémi Duraffort Committed by Neil Williams

Fix namespace typo

key "lava_test_results_dir" should be under the "results" label. The code was
duplicated in most deploy methods to fix this first typo.

Change-Id: I3377d3f38ac81fb2eff564817399095f4228dc74
(cherry picked from commit 93f4aadb)
parent e4bd0f73
......@@ -71,9 +71,6 @@ class ApplyOverlayGuest(Action):
def validate(self):
super(ApplyOverlayGuest, self).validate()
self.set_namespace_data(action=self.name, label='guest', key='name', value=self.guest_filename)
lava_test_results_base = self.parameters['deployment_data']['lava_test_results_dir']
lava_test_results_dir = lava_test_results_base % self.job.job_id
self.set_namespace_data(action='test', label='results', key='lava_test_results_dir', value=lava_test_results_dir)
if 'guest' not in self.job.device['actions']['deploy']['methods']['image']['parameters']:
self.errors = "Device configuration does not specify size of guest filesystem."
......
......@@ -55,20 +55,6 @@ class DockerAction(DeployAction):
except OSError:
raise InfrastructureError("Command 'docker' does not exist")
# Add the lava_test_results_dir to the right namespace
if self.test_needs_deployment(self.parameters):
lava_test_results_dir = self.parameters['deployment_data'][
'lava_test_results_dir']
lava_test_results_dir = lava_test_results_dir % self.job.job_id
self.set_namespace_data(action='test', label='results',
key='lava_test_results_dir',
value=lava_test_results_dir)
lava_test_sh_cmd = self.parameters['deployment_data'][
'lava_test_sh_cmd']
self.set_namespace_data(action=self.name, label='shared',
key='lava_test_sh_cmd',
value=lava_test_sh_cmd)
# check docker image name
# The string should be safe for command line inclusion
image_name = self.parameters["image"]
......
......@@ -95,11 +95,6 @@ class FastbootAction(DeployAction): # pylint:disable=too-many-instance-attribut
super(FastbootAction, self).validate()
if not self.test_needs_deployment(self.parameters):
return
lava_test_results_dir = self.parameters['deployment_data']['lava_test_results_dir']
lava_test_results_dir = lava_test_results_dir % self.job.job_id
self.set_namespace_data(action='test', label='results', key='lava_test_results_dir', value=lava_test_results_dir)
lava_test_sh_cmd = self.parameters['deployment_data']['lava_test_sh_cmd']
self.set_namespace_data(action=self.name, label='shared', key='lava_test_sh_cmd', value=lava_test_sh_cmd)
protocol = [protocol for protocol in self.job.protocols if protocol.name == LxcProtocol.name]
if not protocol:
self.errors = "No LXC device requested"
......
......@@ -141,9 +141,6 @@ class ExtractNfsAction(Action):
super(ExtractNfsAction, self).validate()
if not self.valid:
return
lava_test_results_dir = self.parameters['deployment_data']['lava_test_results_dir']
lava_test_results_dir = lava_test_results_dir % self.job.job_id
self.set_namespace_data(action='test', label='results', key='lava_test_results_dir', value=lava_test_results_dir)
if not self.parameters['images'].get(self.param_key, None): # idempotency
return
if not self.get_namespace_data(
......
......@@ -100,18 +100,6 @@ class LxcAction(DeployAction): # pylint:disable=too-many-instance-attributes
LxcProtocol.name, protocols)
self.errors = "Missing protocol '%s'" % LxcProtocol.name
self.errors = infrastructure_error('lxc-create')
if self.test_needs_deployment(self.parameters):
lava_test_results_dir = self.parameters['deployment_data'][
'lava_test_results_dir']
lava_test_results_dir = lava_test_results_dir % self.job.job_id
self.set_namespace_data(action='test', label='results',
key='lava_test_results_dir',
value=lava_test_results_dir)
lava_test_sh_cmd = self.parameters['deployment_data'][
'lava_test_sh_cmd']
self.set_namespace_data(action=self.name, label='shared',
key='lava_test_sh_cmd',
value=lava_test_sh_cmd)
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job,
......
......@@ -94,11 +94,6 @@ class NbdAction(DeployAction): # pylint:disable=too-many-instance-attributes
if 'ramdisk' in self.parameters:
self.errors = "ramdisk cannot be used with NBD deployment, use a e.g. ext3/4 filesystem as 'initrd' parameter"
if self.test_needs_deployment(self.parameters):
lava_test_results_base = self.parameters['deployment_data']['lava_test_results_dir']
lava_test_results_dir = lava_test_results_base % self.job.job_id
self.set_namespace_data(action='test', label='results', key='lava_test_results_dir', value=lava_test_results_dir)
# Extract the 3 last path elements. See action.mkdtemp()
suffix = os.path.join(*self.tftp_dir.split('/')[-2:])
self.set_namespace_data(action="tftp-deploy", label='tftp', key='suffix', value=suffix)
......
......@@ -75,10 +75,6 @@ class NfsAction(DeployAction): # pylint:disable=too-many-instance-attributes
return
if 'nfsrootfs' in self.parameters and 'persistent_nfs' in self.parameters:
self.errors = "Only one of nfsrootfs or persistent_nfs can be specified"
if self.test_needs_deployment(self.parameters):
lava_test_results_dir = self.parameters['deployment_data']['lava_test_results_dir']
lava_test_results_dir = lava_test_results_dir % self.job.job_id
self.set_namespace_data(action='test', label='results', key='lava_test_results_dir', value=lava_test_results_dir)
def populate(self, parameters):
download_dir = self.mkdtemp()
......
......@@ -88,7 +88,7 @@ class OverlayAction(DeployAction):
return
lava_test_results_dir = self.parameters['deployment_data']['lava_test_results_dir']
lava_test_results_dir = lava_test_results_dir % self.job.job_id
self.set_namespace_data(action='test', label='shared', key='lava_test_results_dir',
self.set_namespace_data(action='test', label='results', key='lava_test_results_dir',
value=lava_test_results_dir)
lava_test_sh_cmd = self.parameters['deployment_data']['lava_test_sh_cmd']
self.set_namespace_data(action='test', label='shared', key='lava_test_sh_cmd',
......
......@@ -281,10 +281,6 @@ class MassStorage(DeployAction): # pylint: disable=too-many-instance-attributes
if not self.valid:
return
if self.test_needs_deployment(self.parameters):
lava_test_results_dir = self.parameters['deployment_data']['lava_test_results_dir']
self.set_namespace_data(action='test', label='results', key='lava_test_results_dir', value=lava_test_results_dir % self.job.job_id)
self.set_namespace_data(action=self.name, label='u-boot', key='device', value=self.parameters['device'])
suffix = os.path.join(*self.image_path.split('/')[-2:])
self.set_namespace_data(action=self.name, label='storage', key='suffix', value=suffix)
......
......@@ -85,9 +85,6 @@ class ScpOverlay(DeployAction):
if not self.test_has_shell(self.parameters):
self.errors = "Scp overlay needs a test action."
return
lava_test_results_base = self.parameters['deployment_data']['lava_test_results_dir']
lava_test_results_dir = lava_test_results_base % self.job.job_id
self.set_namespace_data(action='test', label='results', key='lava_test_results_dir', value=lava_test_results_dir)
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
......@@ -121,9 +118,6 @@ class PrepareOverlayScp(Action):
def validate(self):
super(PrepareOverlayScp, self).validate()
lava_test_results_base = self.parameters['deployment_data']['lava_test_results_dir']
lava_test_results_dir = lava_test_results_base % self.job.job_id
self.set_namespace_data(action='test', label='results', key='lava_test_results_dir', value=lava_test_results_dir)
environment = self.get_namespace_data(
action='deploy-device-env',
label='environment',
......
......@@ -88,10 +88,6 @@ class TftpAction(DeployAction): # pylint:disable=too-many-instance-attributes
self.errors = "Use a persistent_nfs dictionary instead of nfs_url"
if 'nfsrootfs' in self.parameters and 'persistent_nfs' in self.parameters:
self.errors = "Only one of nfsrootfs or persistent_nfs can be specified"
if self.test_needs_deployment(self.parameters):
lava_test_results_base = self.parameters['deployment_data']['lava_test_results_dir']
lava_test_results_dir = lava_test_results_base % self.job.job_id
self.set_namespace_data(action='test', label='results', key='lava_test_results_dir', value=lava_test_results_dir)
# Extract the 3 last path elements. See action.mkdtemp()
suffix = os.path.join(*self.tftp_dir.split('/')[-2:])
self.set_namespace_data(action=self.name, label='tftp', key='suffix', value=suffix)
......
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