{"action":"created","issue":{"url":"https://api.github.com/repos/PowerHMC/HmcRestClient/issues/2","repository_url":"https://api.github.com/repos/PowerHMC/HmcRestClient","labels_url":"https://api.github.com/repos/PowerHMC/HmcRestClient/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/PowerHMC/HmcRestClient/issues/2/comments","events_url":"https://api.github.com/repos/PowerHMC/HmcRestClient/issues/2/events","html_url":"https://github.com/PowerHMC/HmcRestClient/issues/2","id":190164935,"number":2,"title":"tool not working with new HMC xsd schema","user":{"login":"adejoux","id":741174,"avatar_url":"https://avatars.githubusercontent.com/u/741174?v=3","gravatar_id":"","url":"https://api.github.com/users/adejoux","html_url":"https://github.com/adejoux","followers_url":"https://api.github.com/users/adejoux/followers","following_url":"https://api.github.com/users/adejoux/following{/other_user}","gists_url":"https://api.github.com/users/adejoux/gists{/gist_id}","starred_url":"https://api.github.com/users/adejoux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adejoux/subscriptions","organizations_url":"https://api.github.com/users/adejoux/orgs","repos_url":"https://api.github.com/users/adejoux/repos","events_url":"https://api.github.com/users/adejoux/events{/privacy}","received_events_url":"https://api.github.com/users/adejoux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-17T21:10:14Z","updated_at":"2016-11-19T02:26:34Z","closed_at":null,"body":"Hello,\r\n\r\nthis client is really great to learn how the api is working. Thanks for it. :)\r\n\r\nI have a problem with hmc 8.5.0 when fetching PCM informations: \r\n\r\n```````\r\n        Performance and Capacity Monitoring        \r\n=============================================================\r\n1. ManagedSystemPcmPreference\r\n2. LongTermMonitor\r\n3. ShortTermMonitor\r\n4. ProcessorMetrics\r\n5. Return to MainMenu\r\n6. Help\r\n7. Exit\r\n\r\nEnter your Choice: 2\r\nsh: cls: command not found\r\n\r\nAvailable ManagedSystems : \r\nTraceback (most recent call last):\r\n  File \"/usr/local/var/pyenv/versions/py3/bin/HmcRestClient\", line 9, in <module>\r\n    load_entry_point('HmcRestClient==1.0', 'console_scripts', 'HmcRestClient')()\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/HmcRestClient-1.0-py3.4.egg/src/main/Main.py\", line 134, in main\r\n    menu()\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/HmcRestClient-1.0-py3.4.egg/src/main/Main.py\", line 110, in menu\r\n    performance_capacity_monitoring(choice, client.ip, client.x_api_session)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/HmcRestClient-1.0-py3.4.egg/src/main/PerformanceCapacityMonitor.py\", line 43, in performance_capacity_monitoring\r\n    get_managedsystem_uuid(ip, x_api_session)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/HmcRestClient-1.0-py3.4.egg/src/common/SelectManagedSystem.py\", line 29, in get_managedsystem_uuid\r\n    object_list = managedsystem_object.list_ManagedSystem(ip, x_api_session)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/HmcRestClient-1.0-py3.4.egg/src/managed_system/ListManagedSystem.py\", line 50, in list_ManagedSystem\r\n    self.content_type, \"ManagedSystem\", session_id)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/HmcRestClient-1.0-py3.4.egg/src/common/ListModule.py\", line 65, in listing\r\n    xml_object = UOM.CreateFromDocument(xmlstring)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/HmcRestClient-1.0-py3.4.egg/src/generated_src/UOM.py\", line 65, in CreateFromDocument\r\n    saxer.parse(io.BytesIO(xmld))\r\n  File \"/usr/local/var/pyenv/versions/3.4.5/lib/python3.4/xml/sax/expatreader.py\", line 110, in parse\r\n    xmlreader.IncrementalParser.parse(self, source)\r\n  File \"/usr/local/var/pyenv/versions/3.4.5/lib/python3.4/xml/sax/xmlreader.py\", line 123, in parse\r\n    self.feed(buffer)\r\n  File \"/usr/local/var/pyenv/versions/3.4.5/lib/python3.4/xml/sax/expatreader.py\", line 210, in feed\r\n    self._parser.Parse(data, isFinal)\r\n  File \"/private/var/folders/6t/jzq4fbq154nbkbhzdd2f6njc0000gn/T/python-build.20161117090425.38397/Python-3.4.5/Modules/pyexpat.c\", line 405, in StartElement\r\n  File \"/usr/local/var/pyenv/versions/3.4.5/lib/python3.4/xml/sax/expatreader.py\", line 354, in start_element_ns\r\n    AttributesNSImpl(newattrs, qnames))\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/pyxb/binding/saxer.py\", line 370, in startElementNS\r\n    binding_object = this_state.startBindingElement(type_class, new_object_factory, element_decl, attrs)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/pyxb/binding/saxer.py\", line 207, in startBindingElement\r\n    self.__constructElement(new_object_factory, attrs)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/pyxb/binding/saxer.py\", line 135, in __constructElement\r\n    self.__bindingInstance._setAttribute(attr_en, attrs.getValue(attr_name))\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/pyxb/binding/basis.py\", line 2240, in _setAttribute\r\n    au.set(self, value_lex, from_xml=True)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/pyxb/binding/content.py\", line 278, in set\r\n    new_value = self.__dataType.Factory(new_value, _from_xml=from_xml)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/pyxb/binding/basis.py\", line 305, in Factory\r\n    rv = cls._DynamicCreate(*args, **kw)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/pyxb/binding/basis.py\", line 677, in _DynamicCreate\r\n    return ctor(*args, **kw)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/pyxb/binding/basis.py\", line 929, in __init__\r\n    self.xsdConstraintsOK(location)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/pyxb/binding/basis.py\", line 1055, in xsdConstraintsOK\r\n    return self.XsdConstraintsOK(self, location)\r\n  File \"/usr/local/var/pyenv/versions/py3/lib/python3.4/site-packages/pyxb/binding/basis.py\", line 1050, in XsdConstraintsOK\r\n    raise pyxb.SimpleFacetValueError(cls, value, f, location)\r\npyxb.exceptions_.SimpleFacetValueError: Type {http://www.ibm.com/xmlns/systems/power/firmware/uom/mc/2012_10/}SchemaVersion.Enum enumeration constraint violated by value V1_4_0\r\n\r\n``````\r\n"},"comment":{"url":"https://api.github.com/repos/PowerHMC/HmcRestClient/issues/comments/261687042","html_url":"https://github.com/PowerHMC/HmcRestClient/issues/2#issuecomment-261687042","issue_url":"https://api.github.com/repos/PowerHMC/HmcRestClient/issues/2","id":261687042,"user":{"login":"Niraj-Shah-1","id":11884999,"avatar_url":"https://avatars.githubusercontent.com/u/11884999?v=3","gravatar_id":"","url":"https://api.github.com/users/Niraj-Shah-1","html_url":"https://github.com/Niraj-Shah-1","followers_url":"https://api.github.com/users/Niraj-Shah-1/followers","following_url":"https://api.github.com/users/Niraj-Shah-1/following{/other_user}","gists_url":"https://api.github.com/users/Niraj-Shah-1/gists{/gist_id}","starred_url":"https://api.github.com/users/Niraj-Shah-1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Niraj-Shah-1/subscriptions","organizations_url":"https://api.github.com/users/Niraj-Shah-1/orgs","repos_url":"https://api.github.com/users/Niraj-Shah-1/repos","events_url":"https://api.github.com/users/Niraj-Shah-1/events{/privacy}","received_events_url":"https://api.github.com/users/Niraj-Shah-1/received_events","type":"User","site_admin":false},"created_at":"2016-11-19T02:26:34Z","updated_at":"2016-11-19T02:26:34Z","body":"HmcRestClient used PyXB XML parser to transform XML into Python objects and viceversa. UOM.py is a generated source code by PyXB libraries. In this case ListModule is using UOM.py to parse ManagedSystem list XML and load data into Python object and it is getting parsing error due to SchemaVersion.Enum enumeration constraint is violated. The HMC 8.5.0 is using new schema, it is sending response for schema version V1_4_0. The HmcRestClient was written against HMC 8.2.0 version i.e. schema version V1_2_0 hence you are seeing parsing error. Couple of options to resolve the error,\r\n\r\n1. Uplift the generated_src for HMC 8.5.0 schema by doing PyXB compilation. (It is little tricky though!)\r\n2. HMC sends response in latest schema version if it is not specified. If client wants response in older schema format client should explicitely specify SchemaVersion. You can modify ListModule.listing to explicitely send SchemaVersion as V1_2_0 in the request. HMC should respond back for the SchemaVersion V1_2_0. "}}
{"actor":{"display_login":"Niraj-Shah-1"}}