[tog-pegasus/f20] Fix PG_ComputerSystem to have correct CreationClassName value

Tomas Bzatek tbzatek at fedoraproject.org
Thu Oct 24 13:24:17 UTC 2013


commit c1d81c65726f235388373a0fbf8b1630d9fde146
Author: Tomas Bzatek <tbzatek at redhat.com>
Date:   Thu Oct 24 15:24:20 2013 +0200

    Fix PG_ComputerSystem to have correct CreationClassName value

 ....13.0-PG_ComputerSystem.CreationClassName.patch |  175 ++++++++++++++++++++
 tog-pegasus.spec                                   |    9 +-
 2 files changed, 183 insertions(+), 1 deletions(-)
---
diff --git a/pegasus-2.13.0-PG_ComputerSystem.CreationClassName.patch b/pegasus-2.13.0-PG_ComputerSystem.CreationClassName.patch
new file mode 100644
index 0000000..ffda224
--- /dev/null
+++ b/pegasus-2.13.0-PG_ComputerSystem.CreationClassName.patch
@@ -0,0 +1,175 @@
+Index: src/Providers/ManagedSystem/ComputerSystem/ComputerSystem.cpp
+===================================================================
+RCS file: /cvs/MSB/pegasus/src/Providers/ManagedSystem/ComputerSystem/ComputerSystem.cpp,v
+retrieving revision 1.16
+diff -u -b -w -r1.16 ComputerSystem.cpp
+--- src/Providers/ManagedSystem/ComputerSystem/ComputerSystem.cpp	16 Dec 2008 18:57:17 -0000	1.16
++++ src/Providers/ManagedSystem/ComputerSystem/ComputerSystem.cpp	16 Oct 2013 13:13:10 -0000
+@@ -27,12 +27,6 @@
+ //
+ //////////////////////////////////////////////////////////////////////////
+ //
+-// Author: Mike Brasher (mbrasher at bmc.com)
+-//
+-// Modified By: Rudy Schuet (rudy.schuet at compaq.com) 11/12/01
+-//              added nsk platform support
+-//              Sean Keenan Hewlett-Packard Company (sean.keenan at hp.com)
+-//
+ //%/////////////////////////////////////////////////////////////////////////////
+ 
+ #include "ComputerSystem.h"
+Index: src/Providers/ManagedSystem/ComputerSystem/ComputerSystemProvider.cpp
+===================================================================
+RCS file: /cvs/MSB/pegasus/src/Providers/ManagedSystem/ComputerSystem/ComputerSystemProvider.cpp,v
+retrieving revision 1.24
+diff -u -b -w -r1.24 ComputerSystemProvider.cpp
+--- src/Providers/ManagedSystem/ComputerSystem/ComputerSystemProvider.cpp	2 Dec 2008 09:02:26 -0000	1.24
++++ src/Providers/ManagedSystem/ComputerSystem/ComputerSystemProvider.cpp	16 Oct 2013 13:13:10 -0000
+@@ -37,9 +37,9 @@
+ // This provider is registered to support operations at
+ // several class levels:
+ //
+-//  CIM_ComputerSystem
+-//  CIM_UnitaryComputerSystem
+ //  <platform>_ComputerSustem
++//  CIM_UnitaryComputerSystem
++//  CIM_ComputerSystem
+ //
+ // Enumeration operations always return instances from the
+ // deepest class available.  All other
+@@ -95,17 +95,22 @@
+     String keyValue;
+ 
+     if (keys.size() != keyCount)
++    {
+         throw CIMInvalidParameterException("Wrong number of keys");
++    }
+ 
+     for (unsigned int ii = 0; ii < keys.size(); ii++)
+     {
+         keyName = keys[ii].getName();
+         keyValue = keys[ii].getValue();
+ 
++        //Put CLASS_EXTENDED_COMPUTER_SYSTEM in front CLASS_CIM_COMPUTER_SYSTEM
++        //to prefer CLASS_EXTENDED_COMPUTER_SYSTEM as class being served first
++        //followed by CLASS_CIM_UNITARY_COMPUTER_SYSTEM
+         if (keyName.equal(PROPERTY_CREATION_CLASS_NAME) &&
+-            (String::equalNoCase(keyValue,CLASS_CIM_COMPUTER_SYSTEM) ||
++            (String::equalNoCase(keyValue,CLASS_EXTENDED_COMPUTER_SYSTEM) ||
+              String::equalNoCase(keyValue,CLASS_CIM_UNITARY_COMPUTER_SYSTEM) ||
+-             String::equalNoCase(keyValue,CLASS_EXTENDED_COMPUTER_SYSTEM) ||
++             String::equalNoCase(keyValue,CLASS_CIM_COMPUTER_SYSTEM) ||
+              String::equalNoCase(keyValue,String::EMPTY)))
+         {
+             keyCount--;
+@@ -189,7 +194,7 @@
+ 
+         keys.append(CIMKeyBinding(
+             PROPERTY_CREATION_CLASS_NAME,
+-            CLASS_CIM_COMPUTER_SYSTEM,
++            CLASS_EXTENDED_COMPUTER_SYSTEM,
+             CIMKeyBinding::STRING));
+         keys.append(CIMKeyBinding(
+             PROPERTY_NAME,
+@@ -250,9 +255,9 @@
+ 
+ void ComputerSystemProvider::_checkClass(CIMName& className)
+ {
+-    if (!className.equal(CLASS_CIM_COMPUTER_SYSTEM) &&
++    if (!className.equal(CLASS_EXTENDED_COMPUTER_SYSTEM) &&
+         !className.equal(CLASS_CIM_UNITARY_COMPUTER_SYSTEM) &&
+-        !className.equal(CLASS_EXTENDED_COMPUTER_SYSTEM))
++        !className.equal(CLASS_CIM_COMPUTER_SYSTEM))
+     {
+         throw CIMNotSupportedException(String::EMPTY);
+     }
+Index: src/Providers/ManagedSystem/ComputerSystem/ComputerSystemProviderMain.cpp
+===================================================================
+RCS file: /cvs/MSB/pegasus/src/Providers/ManagedSystem/ComputerSystem/ComputerSystemProviderMain.cpp,v
+retrieving revision 1.14
+diff -u -b -w -r1.14 ComputerSystemProviderMain.cpp
+--- src/Providers/ManagedSystem/ComputerSystem/ComputerSystemProviderMain.cpp	16 Dec 2008 18:57:17 -0000	1.14
++++ src/Providers/ManagedSystem/ComputerSystem/ComputerSystemProviderMain.cpp	16 Oct 2013 13:13:10 -0000
+@@ -27,14 +27,6 @@
+ //
+ //////////////////////////////////////////////////////////////////////////
+ //
+-// Author: Christopher Neufeld <neufeld at linuxcare.com>
+-//         David Kennedy       <dkennedy at linuxcare.com>
+-//
+-// Modified By: David Kennedy       <dkennedy at linuxcare.com>
+-//              Christopher Neufeld <neufeld at linuxcare.com>
+-//              Al Stone            <ahs3 at fc.hp.com>
+-//              Mike Glantz         <michael_glantz at hp.com>
+-//
+ //%////////////////////////////////////////////////////////////////////////////
+ 
+ //
+Index: src/Providers/ManagedSystem/ComputerSystem/ComputerSystem_Linux.cpp
+===================================================================
+RCS file: /cvs/MSB/pegasus/src/Providers/ManagedSystem/ComputerSystem/ComputerSystem_Linux.cpp,v
+retrieving revision 1.24
+diff -u -b -w -r1.24 ComputerSystem_Linux.cpp
+--- src/Providers/ManagedSystem/ComputerSystem/ComputerSystem_Linux.cpp	16 Dec 2008 18:57:17 -0000	1.24
++++ src/Providers/ManagedSystem/ComputerSystem/ComputerSystem_Linux.cpp	16 Oct 2013 13:13:10 -0000
+@@ -43,8 +43,6 @@
+ PEGASUS_USING_STD;
+ PEGASUS_USING_PEGASUS;
+ 
+-static String _hostName;
+-
+ ComputerSystem::ComputerSystem()
+ {
+ }
+@@ -304,48 +302,14 @@
+ }
+ 
+ /**
+- * initialize primarily functions to initialize static global variables
+- * that will not be changed frequently. These variables are currently
+- * _hostName.
+- *
++ * This is empty as we get the hostname through
++ * System class
+  */
+ void ComputerSystem::initialize()
+ {
+-    char    hostName[PEGASUS_MAXHOSTNAMELEN + 1];
+-    struct  hostent *hostEntry;
+-
+-    if (gethostname(hostName, sizeof(hostName)) != 0)
+-    {
+-        _hostName.assign("Not initialized");
+-    }
+-    hostName[sizeof(hostName)-1] = 0;
+-
+-    // Now get the official hostname.  If this call fails then return
+-    // the value from gethostname().
+-
+-    char hostEntryBuffer[8192];
+-    struct hostent hostEntryStruct;
+-    int hostEntryErrno;
+-
+-    gethostbyname_r(
+-        hostName,
+-        &hostEntryStruct,
+-        hostEntryBuffer,
+-        sizeof(hostEntryBuffer),
+-        &hostEntry,
+-        &hostEntryErrno);
+-
+-    if (hostEntry)
+-    {
+-        _hostName.assign(hostEntry->h_name);
+-    }
+-    else
+-    {
+-        _hostName.assign(hostName);
+-    }
+ }
+ 
+ String ComputerSystem::getHostName()
+ {
+-    return _hostName;
++    return System::getFullyQualifiedHostName();
+ }
diff --git a/tog-pegasus.spec b/tog-pegasus.spec
index cf11462..9d49373 100644
--- a/tog-pegasus.spec
+++ b/tog-pegasus.spec
@@ -8,7 +8,7 @@
 
 Name:           tog-pegasus
 Version:        %{major_ver}.1
-Release:        9%{?dist}
+Release:        10%{?dist}
 Epoch:          2
 Summary:        OpenPegasus WBEM Services for Linux
 
@@ -87,6 +87,9 @@ Patch28:        pegasus-2.12.1-python-reinit-workaround.patch
 Patch29:        pegasus-2.12.1-interop.patch
 # 30: Add Aarch64 support
 Patch30:        pegasus-2.12.1-aarch64.patch
+# 31: PG_ComputerSystem having CreationClassName="CIM_ComputerSystem"
+# http://bugzilla.openpegasus.org/show_bug.cgi?id=9795
+Patch31:        pegasus-2.13.0-PG_ComputerSystem.CreationClassName.patch
 
 BuildRequires:  bash, sed, grep, coreutils, procps, gcc, gcc-c++
 BuildRequires:  libstdc++, make, pam-devel
@@ -225,6 +228,7 @@ yes | mak/CreateDmtfSchema 233 %{SOURCE9} cim_schema_2.33.0
 %patch28 -p1 -b .python-reinit
 %patch29 -p1 -b .interop
 %patch30 -p1 -b .aarch64
+%patch31 -p0 -b .PG_ComputerSystem.CreationClassName
 
 
 %build
@@ -491,6 +495,9 @@ fi
 
 
 %changelog
+* Thu Oct 24 2013 Tomas Bzatek <tbzatek at redhat.com> - 2:2.12.1-10
+- Fix PG_ComputerSystem to have correct CreationClassName value
+
 * Wed Oct 09 2013 Vitezslav Crhonek <vcrhonek at redhat.com> - 2:2.12.1-9
 - Add version to cim-server virtual provides
 


More information about the scm-commits mailing list