Tools: Dockerfile to run VSPERF in a Container.
[vswitchperf.git] / tools / version.py
1 # Copyright 2017 Intel Corporation.
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 # limitations under the License.
14
15 """Generic class to hold sotware version information shown in the report
16 """
17
18 class Version(object):
19     """Container to keep software version details
20     """
21     def __init__(self, name, version, git_tag='NA'):
22         """Create Version object with given data
23         """
24         self._version = {'name' : name, 'version' : version, 'git_tag' : git_tag}
25
26     def set_value(self, key, value):
27         """Upate given `key` by given `value`
28         """
29         self._version[key] = value
30
31     def get(self):
32         """Get content of version object
33         """
34         return self._version