[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
Tue Sep 15 12:09:17 UTC 2009


Actually, even with a hash I get the same 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

It appears like it can't find the create method in the errata class

Code looks like this:

 	  my $RHNSynopsis = $RHNDetails{errata_synopsis};
	  my $RHNType = $RHNDetails{errata_type};
	  my $RHNTopic = $RHNDetails{errata_topic};
        my $RHNDescription = $RHNDetails{errata_description};
        my $RHNReferences = $RHNDetails{errata_references};
        my $RHNNotes = $RHNDetails{errata_notes};
        my $SWRelease = 1;
        my $SWProduct = "Red Hat";
        my $SWSolution = "Upgrade where applicable";
        my @RHNBugs = [];
        my @RHNKeywords = [];
        my $SWPublish = 1;

        my %Errata_Info = ("synopsis" => $RHNSynopsis,
                                "advisory_name" => $ERRATA_NAME,
                                "advisory_release" => $SWRelease,
                                "advisory_type" => $RHNType,
                                "product" => $SWProduct,
                                "topic" => $RHNTopic,
                                "description" => $RHNDescription,
                                "references" => $RHNReferences,
                                "notes" => $RHNNotes,
                                "solution" => $SWSolution);

 
$SWclient->call('errata.create',$SWsession,%Errata_Info, at RHNBugs, at RHNKeywords
, at Packages,$SWPublish, at Channels);
 

-----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
CONFIDENTIAL: This e-mail, including its contents and attachments,
if any, are confidential. It is neither an offer to buy or sell,
nor a solicitation of an offer to buy or sell, any securities or
any related financial instruments mentioned in it. If you are not
the named recipient please notify the sender and immediately delete
it. You may not disseminate, distribute, or forward this e-mail
message or disclose its contents to anybody else. Unless otherwise
indicated, copyright and any other intellectual property rights in
its contents are the sole property of Mizuho Securities USA Inc.
     E-mail transmission cannot be guaranteed to be secure or
error-free. The sender therefore does not accept liability for any
errors or omissions in the contents of this message which arise as
a result of e-mail transmission.  If verification is required
please request a hard-copy version.
     Although we routinely screen for viruses, addressees should
check this e-mail and any attachments for viruses. We make no
representation or warranty as to the absence of viruses in this
e-mail or any attachments. Please note that to ensure regulatory
compliance and for the protection of our customers and business, we
may monitor and read e-mails sent to and from our server(s).
#####################################################################################




More information about the Spacewalk-list mailing list