Change in vdsm[master]: hwinfo: Add module to get info about the platform
Jenkins CI RO has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 9: Abandoned due to no activity - please restore if still relevant -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Jenkins CI RO Gerrit-Reviewer: Piotr Kliczewski Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
Jenkins CI RO has abandoned this change. Change subject: hwinfo: Add module to get info about the platform .. Abandoned Abandoned due to no activity - please restore if still relevant -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Jenkins CI RO Gerrit-Reviewer: Piotr Kliczewski Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: gerrit-hooks ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
gerrit-hooks has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 9: * Update tracker: IGNORE, no Bug-Url found -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Jenkins CI RO Gerrit-Reviewer: Piotr Kliczewski Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
automat...@ovirt.org has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 9: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
automat...@ovirt.org has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 8: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
automat...@ovirt.org has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 7: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
automat...@ovirt.org has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 6: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
automat...@ovirt.org has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 5: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
automat...@ovirt.org has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 4: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
Yaniv Bronhaim has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 3: Code-Review-1 (2 comments) https://gerrit.ovirt.org/#/c/44599/3/lib/vdsm/hwinfo.py File lib/vdsm/hwinfo.py: Line 16: # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Line 17: # Line 18: # Refer to the README and COPYING files for full details of the license Line 19: # Line 20: import logging consider putting under lib/vdsm/infra/ Line 21: import os Line 22: import platform Line 23: Line 24: from vdsm import constants Line 36: @utils.memoized Line 37: @supervdsm.named_proxied_call('getHardwareInfo') Line 38: def get_hardware_info(): Line 39: if platform.machine() in ('x86_64', 'i686'): Line 40: from dmidecodeUtil import getHardwareInfoStructure dmidecodeUtil won't be available here.. you need to move it to lib as well Line 41: return getHardwareInfoStructure() Line 42: elif platform.machine() in Architecture.POWER: Line 43: from ppc64HardwareInfo import getHardwareInfoStructure Line 44: return getHardwareInfoStructure() -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
automat...@ovirt.org has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 3: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
automat...@ovirt.org has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 2: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: Yeela Kaplan Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
automat...@ovirt.org has posted comments on this change. Change subject: hwinfo: Add module to get info about the platform .. Patch Set 1: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: hwinfo: Add module to get info about the platform
Dima Kuznetsov has uploaded a new change for review. Change subject: hwinfo: Add module to get info about the platform .. hwinfo: Add module to get info about the platform Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Signed-off-by: Dima Kuznetsov --- M debian/vdsm-python.install M lib/vdsm/Makefile.am A lib/vdsm/hwinfo.py M vdsm.spec.in 4 files changed, 64 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/99/44599/1 diff --git a/debian/vdsm-python.install b/debian/vdsm-python.install index f4aea24..8f3a182 100644 --- a/debian/vdsm-python.install +++ b/debian/vdsm-python.install @@ -9,6 +9,7 @@ ./usr/lib/python2.7/dist-packages/vdsm/define.py ./usr/lib/python2.7/dist-packages/vdsm/exception.py ./usr/lib/python2.7/dist-packages/vdsm/executor.py +./usr/lib/python2.7/dist-packages/vdsm/hwinfo.py ./usr/lib/python2.7/dist-packages/vdsm/ipwrapper.py ./usr/lib/python2.7/dist-packages/vdsm/jsonrpcvdscli.py ./usr/lib/python2.7/dist-packages/vdsm/libvirtconnection.py diff --git a/lib/vdsm/Makefile.am b/lib/vdsm/Makefile.am index 02faeb8..1cc74ab 100644 --- a/lib/vdsm/Makefile.am +++ b/lib/vdsm/Makefile.am @@ -29,6 +29,7 @@ define.py \ exception.py \ executor.py \ + hwinfo.py \ ipwrapper.py \ jsonrpcvdscli.py \ libvirtconnection.py \ diff --git a/lib/vdsm/hwinfo.py b/lib/vdsm/hwinfo.py new file mode 100644 index 000..3e97459 --- /dev/null +++ b/lib/vdsm/hwinfo.py @@ -0,0 +1,61 @@ +# +# Copyright 2015 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# +import logging +import os +import platform + +from vdsm import constants +from vdsm import supervdsm +from vdsm import utils + + +class Architecture: +X86_64 = 'x86_64' +PPC64 = 'ppc64' +PPC64LE = 'ppc64le' +POWER = (PPC64, PPC64LE) + + +@utils.memoized +@supervdsm.named_proxied_call('getHardwareInfo') +def get_hardware_info(): +if platform.machine() in ('x86_64', 'i686'): +from dmidecodeUtil import getHardwareInfoStructure +return getHardwareInfoStructure() +elif platform.machine() in Architecture.POWER: +from ppc64HardwareInfo import getHardwareInfoStructure +return getHardwareInfoStructure() +else: +# not implemented over other architecture +return {} + + +@utils.memoized +def get_host_uuid(legacy=False): +if legacy: +raise NotImplementedError + +if os.path.exists(constants.P_VDSM_NODE_ID): +with open(constants.P_VDSM_NODE_ID) as f: +return f.readline().strip() +try: +return get_hardware_info()['systemUUID'] +except KeyError: +logging.error("Error retrieving host UUID", exc_info=True) diff --git a/vdsm.spec.in b/vdsm.spec.in index 98ee569..60bb4d8 100644 --- a/vdsm.spec.in +++ b/vdsm.spec.in @@ -1045,6 +1045,7 @@ %{python_sitelib}/%{vdsm_name}/define.py* %{python_sitelib}/%{vdsm_name}/exception.py* %{python_sitelib}/%{vdsm_name}/executor.py* +%{python_sitelib}/%{vdsm_name}/hwinfo.py* %{python_sitelib}/%{vdsm_name}/ipwrapper.py* %{python_sitelib}/%{vdsm_name}/jsonrpcvdscli.py* %{python_sitelib}/%{vdsm_name}/libvirtconnection.py* -- To view, visit https://gerrit.ovirt.org/44599 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a221f3f357038a3e1c6181d1abb53f4ad09c826 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dima Kuznetsov ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches