23
23
class cmd_deploy_linaro_image(BaseAction):
24
def run(self, hwpack=None, rootfs=None, image=None, kernel_matrix=None, use_cache=True, rootfstype='ext3'):
25
# This is how the schema for parameters should look, but there are bugs in
26
# json_schema_validation that means it doesn't work (see
27
# https://github.com/zyga/json-schema-validator/pull/6).
29
## parameters_schema = {
34
## 'image': {'type': 'string'},
36
## 'additionalProperties': False,
41
## 'hwpack': {'type': 'string'},
42
## 'rootfs': {'type': 'string'},
43
## 'kernel_matrix': {'type': 'string', 'optional': True},
44
## 'use_cache': {'type': 'bool', 'optional': True, 'default': True},
45
## 'rootfstype': {'type': 'string', 'optional': True, 'default': 'ext3'},
47
## 'additionalProperties': False,
55
'hwpack': {'type': 'string', 'optional': True},
56
'rootfs': {'type': 'string', 'optional': True},
57
'image': {'type': 'string', 'optional': True},
58
'kernel_matrix': {'type': 'string', 'optional': True},
59
'use_cache': {'type': 'bool', 'optional': True},
60
'rootfstype': {'type': 'string', 'optional': True},
62
'additionalProperties': False,
66
def validate_parameters(cls, parameters):
67
super(cmd_deploy_linaro_image, cls).validate_parameters(parameters)
68
if 'hwpack' in parameters:
69
if 'rootfs' not in parameters:
70
raise ValueError('must specify rootfs when specifying hwpack')
71
if 'image' in parameters:
72
raise ValueError('cannot specify image and hwpack')
73
elif 'image' not in parameters:
74
raise ValueError('must specify image if not specifying a hwpack')
75
elif 'kernel_matrix' in parameters:
76
raise ValueError('cannot specify kernel_matrix with an image')
78
def run(self, hwpack=None, rootfs=None, image=None, kernel_matrix=None,
79
use_cache=True, rootfstype='ext3'):
25
80
self.client.deploy_linaro(
26
hwpack=hwpack, rootfs=rootfs, image=image, kernel_matrix=kernel_matrix, use_cache=use_cache, rootfstype=rootfstype)
81
hwpack=hwpack, rootfs=rootfs, image=image,
82
kernel_matrix=kernel_matrix, use_cache=use_cache,
83
rootfstype=rootfstype)