How to use with python?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use with python?

Henry Beatty
Hello,

I'm new to python and openwsman. I'm trying to write a script to communicate with a Dell iDrac:

#!/usr/bin/env python

from pywsman import *

client = Client("<a class="moz-txt-link-freetext" href="https://">https://<user>:<pass>@<host>:443")
assert client is not None
options = ClientOptions()
assert options is not None
options.add_selector("InstanceID", "JobID")

uri = pywsman.epr_uri_for ('root/dcim', 'DCIM_LifecycleJob')

doc = client.get( options )
print "Document [%s]" % doc
when I run the above:

Traceback (most recent call last):
  File "understand-python-openwsman.py", line 3, in <module>
    from pywsman import *
  File "/usr/lib/python2.6/site-packages/pywsman.py", line 25, in <module>
    _pywsman = swig_import_helper()
  File "/usr/lib/python2.6/site-packages/pywsman.py", line 17, in swig_import_helper
    import _pywsman
ImportError: /usr/lib64/python2.6/site-packages/_pywsman.so: undefined symbol: SWIG_exception

The corresponding wsman:

wsman enumerate http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_LifecycleJob -h <ip address> -V -v -c dummy.cert -P 443 -u <user> -p <pass> -j utf-8 -y basic


This is on CentOS 6.6 with epel-release installed and the latest versions of openwsman-python and python.

Any help would be very much appreciated.

Thanks,
Hank



------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use with python?

Klaus Kaempf
* Henry Beatty <[hidden email]> [Feb 18. 2015 16:49]:

Hank,

your issue looks like a installation bug.

>
> This is on CentOS 6.6 with epel-release installed and the latest
> versions of openwsman-python and python.

From where did you get the 'latest versions' ?
- via RPM ?
- compiled from source ?

See
https://github.com/Openwsman/openwsman/tree/master/bindings/python/tests
for more Python samples with Openwsman.

Klaus
--
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use with python?

Henry Beatty
On 2/19/15 10:02 AM, Klaus Kaempf wrote:

> * Henry Beatty <[hidden email]> [Feb 18. 2015 16:49]:
>
> Hank,
>
> your issue looks like a installation bug.
>
>> This is on CentOS 6.6 with epel-release installed and the latest
>> versions of openwsman-python and python.
>  From where did you get the 'latest versions' ?
> - via RPM ?
> - compiled from source ?
>
> See
> https://github.com/Openwsman/openwsman/tree/master/bindings/python/tests
> for more Python samples with Openwsman.
>
> Klaus
Hello Klaus,

I installed these from RPM via yum.

Thanks,
Hank

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use with python?

Henry Beatty

On 2/20/15 3:08 AM, Klaus Kaempf wrote:
* Hank Beatty [hidden email] [Feb 19. 2015 16:18]:
Hello Klaus,

I installed these from RPM via yum.
Ok. From where did you get the RPMs and what's the exact version ?

Klaus
Hello Klaus,

It looks like they are both part of the CentOS distro:

openwsman-python.x86_64                    2.2.3-8.el6                   @base 
openwsman-client.i686                      2.2.3-8.el6                   base  
openwsman-client.x86_64                    2.2.3-8.el6                   base  
openwsman-perl.x86_64                      2.2.3-8.el6                   base  
openwsman-ruby.x86_64                      2.2.3-8.el6                   base  
openwsman-server.i686                      2.2.3-8.el6                   base  
openwsman-server.x86_64                    2.2.3-8.el6                   base  
python.x86_64                              2.6.6-52.el6                  @base

Thanks,
Hank

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use with python?

Klaus Kaempf
* Hank Beatty <[hidden email]> [Feb 20. 2015 12:24]:
>
> It looks like they are both part of the CentOS distro:
>
> openwsman-python.x86_64 2.2.3-8.el6                   @base

Hmm, your problem points to an installation issue. This would mean
that CentOS didn't test openwsman-python at all.

What does "rpm -qi openwsman-python" report ?


Klaus
--
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use with python?

Henry Beatty

On 2/20/15 6:31 AM, Klaus Kaempf wrote:
> rpm -qi openwsman-python
Name        : openwsman-python             Relocations: (not relocatable)
Version     : 2.2.3                             Vendor: CentOS
Release     : 8.el6                         Build Date: Tue 19 Jul 2011
04:11:13 AM UTC
Install Date: Wed 18 Feb 2015 12:33:47 PM UTC      Build Host:
c6b5.bsys.dev.centos.org
Group       : Development/Libraries         Source RPM:
openwsman-2.2.3-8.el6.src.rpm
Size        : 364032                           License: BSD
Signature   : RSA/SHA1, Mon 26 Sep 2011 04:22:44 AM UTC, Key ID
0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>
URL         : http://www.openwsman.org/
Summary     : Python bindings for openwsman client API
Description :
This package provides Python bindings to access the openwsman client
API.


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to use with python?

Klaus Kaempf
* Hank Beatty <[hidden email]> [Feb 20. 2015 12:37]:
>
> On 2/20/15 6:31 AM, Klaus Kaempf wrote:
> > rpm -qi openwsman-python
> Name        : openwsman-python             Relocations: (not relocatable)
> Version     : 2.2.3                             Vendor: CentOS
> Release     : 8.el6                         Build Date: Tue 19 Jul 2011
> 04:11:13 AM UTC
> Install Date: Wed 18 Feb 2015 12:33:47 PM UTC      Build Host:
> c6b5.bsys.dev.centos.org

This seems to be an official CentOS package (but a pretty old one ;-))

I can't really say what's wrong with the package, you might need to
contact CentOS.

As an alternative, grab the latest and greatest version of Openwsman
from
http://download.opensuse.org/repositories/Openwsman/CentOS_CentOS-6

Hth,

Klaus
--
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel