Moshe | 0bb532c | 2018-02-26 13:39:57 +0200 | [diff] [blame] | 1 | ############################################################################## |
| 2 | # Copyright 2018 EuropeanSoftwareMarketingLtd. |
| 3 | # =================================================================== |
| 4 | # Licensed under the ApacheLicense, Version2.0 (the"License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # software distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | # See the License for the specific language governing permissions and limitations under |
| 12 | # the License |
| 13 | ############################################################################## |
| 14 | # vnftest comment: this is a modified copy of |
| 15 | # yardstick/cmd/commands/step.py |
| 16 | """ Handler for vnftest command 'step' """ |
| 17 | |
| 18 | from __future__ import print_function |
| 19 | from __future__ import absolute_import |
Moshe | 30497ac | 2018-03-14 14:22:13 +0200 | [diff] [blame^] | 20 | from vnftest.core.step import Steps |
Moshe | 0bb532c | 2018-02-26 13:39:57 +0200 | [diff] [blame] | 21 | from vnftest.common.utils import cliargs |
| 22 | from vnftest.cmd.commands import change_osloobj_to_paras |
| 23 | |
| 24 | |
| 25 | class StepCommands(object): # pragma: no cover |
| 26 | """Step commands. |
| 27 | |
| 28 | Set of commands to discover and display step types. |
| 29 | """ |
| 30 | |
| 31 | def do_list(self, args): |
| 32 | """List existing step types""" |
| 33 | param = change_osloobj_to_paras(args) |
| 34 | Steps().list_all(param) |
| 35 | |
| 36 | @cliargs("type", type=str, help="runner type", nargs=1) |
| 37 | def do_show(self, args): |
| 38 | """Show details of a specific step type""" |
| 39 | param = change_osloobj_to_paras(args) |
| 40 | Steps().show(param) |