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

Jesus M. Rodriguez jesusr at redhat.com
Mon Sep 14 18:09:12 UTC 2009


-----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,$RHNNotes,$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-----




More information about the Spacewalk-list mailing list