client-id is now required when creating jobs
Change-Id: I6598ac3a14935c9b00efa4315b74b95d73781999
This commit is contained in:
parent
5e88395416
commit
85a7cdd7a6
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
}
|
@ -185,14 +185,24 @@ class JobCreate(command.Command):
|
||||
"""Create a new job from a file"""
|
||||
def get_parser(self, prog_name):
|
||||
parser = super(JobCreate, self).get_parser(prog_name)
|
||||
parser.add_argument('--file',
|
||||
dest='file',
|
||||
required=True,
|
||||
help='Path to json file with the job')
|
||||
parser.add_argument(
|
||||
'--file',
|
||||
dest='file',
|
||||
required=True,
|
||||
help='Path to json file with the job')
|
||||
|
||||
parser.add_argument(
|
||||
'--client', '-C',
|
||||
dest='client_id',
|
||||
required=True,
|
||||
help='Select a client for this job',
|
||||
)
|
||||
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
job = utils.doc_from_json_file(parsed_args.file)
|
||||
job['client_id'] = parsed_args.client_id
|
||||
job_id = self.app.client.jobs.create(job)
|
||||
logging.info('Job {0} created'.format(job_id))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user