[Spacewalk-list] Creating perl script to use Spacewalk API butgetting error Could not find method create

Frey, Evan evan.frey at us.mizuho-sc.com
Mon Sep 14 18:27:10 UTC 2009


*smacks self in head*

Thanks, sometimes you just need another pair of eyes :) 

-----Original Message-----
From: spacewalk-list-bounces at redhat.com
[mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Jesus M. Rodriguez
Sent: Monday, September 14, 2009 2:09 PM
To: spacewalk-list at redhat.com
Subject: Re: [Spacewalk-list] Creating perl script to use Spacewalk API
butgetting error Could not find method create

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/14/2009 02:01 PM, Frey, Evan wrote:
> I am creating a perl script to publish errata from RHN to my Spacewalk 
> server.  I created the string to send to Spacewalk but when I push it 
> I get the following error
>  
>     Fault returned from XML RPC Server, fault code -1:
> redstone.xmlrpc.XmlRpcFault: Could not find method create in class 
> class com.redhat.rhn.frontend.xmlrpc.errata.ErrataHandler
>  
> I'm not sure why it can't find the create class as I am running v.6 
> which has the errata.create class.
>  
> Any ideas?
>  
> Line that borks:
>  
> $SWclient->call('errata.create',$SWsession,$RHNSynopsis,$ERRATA_NAME,$
> SWRelea 
> se,$RHNType,$SWProduct,$RHNTopic,$RHNDescription,$RHNReferences,$RHNNo
> tes,$SW 
> Solution, at RHNBugs, at RHNKeywords, at Packages,$SWPublish, at Channels);

You need to create a hash as the second parameter

%erratainfo = ("synopsis" => $RHNSynopsis,
               "advisory_name" => $ERRATA_NAME,
               ...

So everything from $RHNSynopsis to $SWSolution should be in the above hash.
Then your call looks more like this:

call('errata.create', $SWsession, %erratainfo, @RHNBugs,
   @RHNKeywords, @Packages, $SWPublish, @Channels);

jesus

- -- 
jesus m. rodriguez        | jesusr at redhat.com
sr. software engineer     | irc: zeus
rhn satellite & spacewalk | 919.754.4413 (w)
rhce # 805008586930012    | 919.623.0080 (c)
+-------------------------------------------+
|  "Those who cannot remember the past      |
|   are condemned to repeat it."            |
|                       -- George Santayana |
+-------------------------------------------+

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkquhsgACgkQvJZ57YntiYP6eACfQhxzrax17Q5IskQQVFb1pb+W
kR4AoKRDVGBWixaQ7kOgwu+osM9xejUF
=uuvI
-----END PGP SIGNATURE-----

_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list




More information about the Spacewalk-list mailing list