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

Jesus M. Rodriguez jmrodri at gmail.com
Tue Sep 15 13:08:42 UTC 2009


On Tue, Sep 15, 2009 at 8:09 AM, Frey, Evan <evan.frey at us.mizuho-sc.com> wrote:
> 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

Hrm ok, it's trying to find a match by method name AND parameter
types. For some reason it can't find a match for one of the types. We
need to put
your client into debug mode so we can see the XML-RPC that it is sending to the
Spacewalk server.

If you are using Frontier::RPC then you can just turn on the debug flag when you
create the client:

   my $conn = new Frontier::Client(url => $host, debug => 1);

that will output the XML-RPC for the errata.create call. Then paste
the output to
http://pastie.org/ and send the link to the list.

>
> 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);

jesus




More information about the Spacewalk-list mailing list