Merge ~pwlars/testflinger-cli:offer-cancel-job into testflinger-cli:master
Status: | Merged |
---|---|
Approved by: | Paul Larson |
Approved revision: | a2ec8186917cfce50803767a22aa69dd8c85c24c |
Merged at revision: | ee433cb7d8844b0628c210c76c03929f37774201 |
Proposed branch: | ~pwlars/testflinger-cli:offer-cancel-job |
Merge into: | testflinger-cli:master |
Diff against target: |
83 lines (+37/-19) 1 file modified
testflinger_cli/__init__.py (+37/-19) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lukas Waymann (community) | Approve | ||
Sheila Miguez (community) | Approve | ||
Review via email:
|
Description of the change
Small improvement from a suggested Lukas had today - when a user presses ctrl-C while polling the output, we can offer to either let them cancel the job or keep the job running in the background. I also added an option to let it just continue running the job and polling. Here's what a session looks like, showing all three selections:
13:55 $ testflinger reserve
Which queue do you want to use? ('?' to list) rpi3bp
Enter the name of the image you want to use or URL for a valid image starting with http(s)://... ('?' to list) core20-armhf-beta
Enter the ssh key(s) you wish to use: (ex: lp:userid, gh:userid) lp:pwlars
The following yaml will be submitted:
job_queue: rpi3bp
provision_data:
url: http://
reserve_data:
ssh_keys:
- lp:pwlars
Proceed? (Y/n)
Job submitted successfully!
job_id: 17e8e062-
This job is waiting on a node to become available.
Jobs ahead in queue: 0
*******
* Starting testflinger setup phase on rpi3bp-004 *
*******
Cleaning up container if it exists...
Error: No such container: rpi3bp004
*******
* Starting testflinger provision phase on rpi3bp-004 *
*******
^C
Cancel job 17e8e062-
2020-11-20 19:56:37,003 rpi3bp_004 INFO: DEVICE AGENT: BEGIN provision
2020-11-20 19:56:37,003 rpi3bp_004 INFO: DEVICE AGENT: Booting Master Image
2020-11-20 19:56:37,003 rpi3bp_004 INFO: DEVICE AGENT: Making sure the master image is booted
2020-11-20 19:56:37,003 rpi3bp_004 INFO: DEVICE AGENT: Checking if test image booted.
2020-11-20 19:56:37,174 rpi3bp_004 INFO: DEVICE AGENT: Checking if master image booted.
2020-11-20 19:56:37,503 rpi3bp_004 INFO: DEVICE AGENT: Downloading file from http://
^C
Cancel job 17e8e062-
13:57 $ testflinger poll 17e8e062-
2020-11-20 19:57:08,742 rpi3bp_004 INFO: DEVICE AGENT: Flashing Test Image
2020-11-20 19:57:09,195 rpi3bp_004 INFO: DEVICE AGENT: Running: nc.traditional 10.101.49.222 35473| xzcat| sudo dd of=/dev/mmcblk0 bs=16M
^C
Cancel job 17e8e062-
13:57 $ testflinger status 17e8e062-
cancelled
(ignore the bad line break in the middle of the options, it doesn't look that way - just lp reformatting it for me)