Martin Cosyns | f88ed6e | 2020-12-02 10:30:10 +0100 | [diff] [blame^] | 1 | # Copyright 2020 ADTRAN, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | import dmi |
| 14 | |
| 15 | from robot.api.deco import keyword |
| 16 | from grpc_robot.grpc_robot import GrpcRobot |
| 17 | |
| 18 | |
| 19 | class GrpcDmiRobot(GrpcRobot): |
| 20 | """ |
| 21 | This library is intended to supported different Protocol Buffer definitions. Precondition is that python files |
| 22 | generated from Protocol Buffer files are available in a pip package which must be installed before the library |
| 23 | is used. |
| 24 | |
| 25 | | Supported device | Pip package | Pip package version | Library Name | |
| 26 | | dmi | device-management-interface | 0.9.1 | grpc_robot.Dmi | |
| 27 | | dmi | device-management-interface | 0.9.2 | grpc_robot.Dmi | |
| 28 | | dmi | device-management-interface | 0.9.3 | grpc_robot.Dmi | |
| 29 | | dmi | device-management-interface | 0.9.4 | grpc_robot.Dmi | |
| 30 | | dmi | device-management-interface | 0.9.5 | grpc_robot.Dmi | |
| 31 | """ |
| 32 | |
| 33 | device = 'dmi' |
| 34 | package_name = 'device-management-interface' |
| 35 | installed_package = dmi |
| 36 | |
| 37 | def __init__(self, **kwargs): |
| 38 | super().__init__(**kwargs) |
| 39 | |
| 40 | @keyword |
| 41 | def dmi_version_get(self): |
| 42 | """ |
| 43 | Retrieve the version of the currently used python module _device-management-interface_. |
| 44 | |
| 45 | *Return*: version string consisting of three dot-separated numbers (x.y.z) |
| 46 | """ |
| 47 | return self.pb_version |