No subject


Fri Nov 9 03:22:17 UTC 2012


#!/usr/bin/perl

use strict;
use warnings;
use XMLRPC::Lite;
use Data::Dumper;
use diagnostics;

my $username =3D 'api-user';
my $password =3D 'api-user';
my $proto =3D 'http://';
my $servername =3D 'spacewalk';
my $api =3D '/cobbler_api';
my $url =3D $proto . $servername . $api;
my $name =3D 'vacsld01test';


my $conn =3D XMLRPC::Lite->proxy('https://vacslp01spacewalk.cucbc.com/cobbl=
er_api');
my $token =3D $conn->login($username, $password)->result();
my $object =3D $conn->new_system($token)->result();
print "new system id is $object\n";

my $ret;
$ret =3D $conn->modify_system($object, 'name', $name, $token)->result();
print "modify name:" . $ret . "\n";
$ret =3D $conn->modify_system($object, 'hostname', $name, $token)->result()=
;
print "modify hostname: " . $ret . "\n";
$ret =3D $conn->save_system($object, $token);
print "save system: " . $ret . "\n";
$ret =3D $conn->sync($token)->result();
print "sync:" . $ret . "\n";

From: cobbler-bounces at lists.fedorahosted.org [mailto:cobbler-bounces at lists.=
fedorahosted.org] On Behalf Of James Clendenan
Sent: Thursday, November 08, 2012 5:32 PM
To: cobbler mailing list
Subject: Re: [cobbler] Problems with writing systems through the XMLRPC API=
 using perl XML::RPC or XMLRPC::Lite

I'm not going to be much help on this, but one thought I would have is that=
 you're not checking the return of the result call, which could be trying t=
o tell you something about an error.  I do recall when trying to do a pytho=
n interface to do similar, it was usually that I was missing one of the req=
uired host fields.

You should also take a look at the test cases for the webui as it also uses=
 the xmlrpc interface for it's work.

James
On Thu, Nov 8, 2012 at 4:10 PM, Jason Barlow <jbarlow at central1.com<mailto:j=
barlow at central1.com>> wrote:
I'm trying to create a new system profile using perl through the XMLRPC API=
.

Things work great using python, but when I try to use either of the above p=
erl interfaces, I'm not able to actually write any of the new objects I've =
created:

Reading items works a charm, and it looks like the calls themselves are suc=
ceeding, but the host never shows up in a:
#[root at spacewalk cobbler]# cobbler system list | grep test
#

I'm wondering what's going wrong here; am I not authenticating properly?

I've tried using both XML::RPC and XMLRPC::Lite, and get similar results, w=
here reads work fine, but nothing actually 'sticks'

Here's the script that I'm using for XMLRPC::Lite

#!/usr/bin/perl

use strict;
use warnings;
use XMLRPC::Lite;
use Data::Dumper;

my $username =3D 'api-user';
my $password =3D 'sapi-user';
my $proto =3D 'http://';
my $servername =3D 'spacewak';
my $api =3D '/cobbler_api';
my $url =3D $proto . $servername . $api;
my $name =3D 'vacsld01test';


my $conn =3D XMLRPC::Lite->proxy('https://vacslp01spacewalk.cucbc.com/cobbl=
er_api');
my $token =3D $conn->login($username, $password)->result();
my $object =3D $conn->new_system($token)->result();

$conn->modify_system($object, 'name', $name, $token)->result();
$conn->modify_system($object, 'hostname', $name, $token)->result();
$conn->save_system($object, $token)->result();
$conn->sync($token)->result();


/var/log/cobbler/cobbler.log has:

Thu Nov  8 16:03:46 2012 - INFO | authenticate; ['api-user', True]
Thu Nov  8 16:03:46 2012 - INFO | REMOTE new_item(system); user(api-user)
Thu Nov  8 16:03:46 2012 - DEBUG | authorize; ['api-user', 'new_system', No=
ne, None, True]
Thu Nov  8 16:03:46 2012 - DEBUG | REMOTE api-user authorization result: Tr=
ue; user(?)
Thu Nov  8 16:03:46 2012 - INFO | REMOTE modify_item(system); user(api-user=
); object_id(___NEW___system::o0X5NLQrLsh9rXGhtvbuts56aTY6zb4JfQ=3D=3D); at=
tribute(name)
Thu Nov  8 16:03:46 2012 - DEBUG | authorize; ['api-user', 'modify_system',=
 <cobbler.item_system.System instance at 0x14350560>, 'name', True]
Thu Nov  8 16:03:46 2012 - DEBUG | REMOTE api-user authorization result: Tr=
ue; user(?)
Thu Nov  8 16:03:46 2012 - INFO | REMOTE modify_item(system); user(api-user=
); object_id(___NEW___system::o0X5NLQrLsh9rXGhtvbuts56aTY6zb4JfQ=3D=3D); at=
tribute(hostname)
Thu Nov  8 16:03:46 2012 - DEBUG | authorize; ['api-user', 'modify_system',=
 <cobbler.item_system.System instance at 0x14350560>, 'hostname', True]
Thu Nov  8 16:03:46 2012 - DEBUG | REMOTE api-user authorization result: Tr=
ue; user(?)
Thu Nov  8 16:03:46 2012 - INFO | REMOTE save_item(system); user(api-user);=
 object_id(___NEW___system::o0X5NLQrLsh9rXGhtvbuts56aTY6zb4JfQ=3D=3D)
Thu Nov  8 16:03:46 2012 - DEBUG | authorize; ['api-user', 'save_system', <=
cobbler.item_system.System instance at 0x14350560>, None, True]
Thu Nov  8 16:03:46 2012 - DEBUG | REMOTE api-user authorization result: Tr=
ue; user(?)
Thu Nov  8 16:03:46 2012 - INFO | add_item(system); ['vacsld01test']
Thu Nov  8 16:03:46 2012 - DEBUG | get_items; ['system']
Thu Nov  8 16:03:46 2012 - INFO | REMOTE sync; user(api-user)
Thu Nov  8 16:03:46 2012 - DEBUG | authorize; ['api-user', 'sync', None, No=
ne, True]
Thu Nov  8 16:03:46 2012 - DEBUG | REMOTE api-user authorization result: Tr=
ue; user(?)
Thu Nov  8 16:03:46 2012 - INFO | sync
Thu Nov  8 16:03:46 2012 - INFO | running pre-sync triggers
Thu Nov  8 16:03:46 2012 - INFO | cleaning trees

I'm using:

cobbler2-2.0.11-4.el5 ( CentOS 5.8)
perl v5.10.1
XMLRPC::Lite 0.715

_______________________________________________
cobbler mailing list
cobbler at lists.fedorahosted.org<mailto:cobbler at lists.fedorahosted.org>
https://lists.fedorahosted.org/mailman/listinfo/cobbler


--_000_4470426D5F017A46BE3A83292FD5D2B54AB6887C3AEVS1csadcentr_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV=3D"Content-Type" CONTENT=
=3D"text/html; charset=3Dus-ascii"><meta name=3DGenerator content=3D"Micros=
oft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue vli=
nk=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span style=3D'f=
ont-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks fo=
r the suggestion.<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'=
font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nb=
sp;</o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;fo=
nt-family:"Calibri","sans-serif";color:#1F497D'>I&#8217;m now checking the =
return values, and I&#8217;ve removed a failing &#8216;modify_system call&#=
8217;.&nbsp; Everything checks out ok according to the return values, and I=
&#8217;m able to read stuff just fine, but the writes just are not taking.<=
o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;f=
ont-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></=
p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri=
","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNor=
mal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";colo=
r:#1F497D'>Output:<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D=
'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&n=
bsp;</o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;f=
ont-family:"Calibri","sans-serif";color:#1F497D'>new system id is ___NEW___=
system::G2EjtpYQF6V3eb+WvYbocQcEFSqEOEBoCg=3D=3D<o:p></o:p></span></p><p cl=
ass=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans=
-serif";color:#1F497D'>modify name:1<o:p></o:p></span></p><p class=3DMsoNor=
mal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";colo=
r:#1F497D'>modify hostname: 1<o:p></o:p></span></p><p class=3DMsoNormal><sp=
an style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F49=
7D'>save system: 1<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D=
'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>sync:1<=
o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;f=
ont-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></=
p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri=
","sans-serif";color:#1F497D'>[root at spacewalk cobbler]# cobbler system list=
 | grep vacsld01test<o:p></o:p></span></p><p class=3DMsoNormal><span style=
=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>[roo=
t at vspacewalk cobbler]#<o:p></o:p></span></p><p class=3DMsoNormal><span styl=
e=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:=
p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0=
pt;font-family:"Calibri","sans-serif";color:#1F497D'>From the following cod=
e:<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0p=
t;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span=
></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Cali=
bri","sans-serif";color:#1F497D'>#!/usr/bin/perl<o:p></o:p></span></p><p cl=
ass=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans=
-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><sp=
an style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F49=
7D'>use strict;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'fo=
nt-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>use warnin=
gs;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0=
pt;font-family:"Calibri","sans-serif";color:#1F497D'>use XMLRPC::Lite;<o:p>=
</o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-=
family:"Calibri","sans-serif";color:#1F497D'>use Data::Dumper;<o:p></o:p></=
span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"=
Calibri","sans-serif";color:#1F497D'>use diagnostics;<o:p></o:p></span></p>=
<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNorma=
l><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:=
#1F497D'>my $username =3D 'api-user';<o:p></o:p></span></p><p class=3DMsoNo=
rmal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";col=
or:#1F497D'>my $password =3D 'api-user';<o:p></o:p></span></p><p class=3DMs=
oNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";=
color:#1F497D'>my $proto =3D 'http://';<o:p></o:p></span></p><p class=3DMso=
Normal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";c=
olor:#1F497D'>my $servername =3D 'spacewalk';<o:p></o:p></span></p><p class=
=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-se=
rif";color:#1F497D'>my $api =3D '/cobbler_api';<o:p></o:p></span></p><p cla=
ss=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-=
serif";color:#1F497D'>my $url =3D $proto . $servername . $api;<o:p></o:p></=
span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"=
Calibri","sans-serif";color:#1F497D'>my $name =3D 'vacsld01test';<o:p></o:p=
></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-famil=
y:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p clas=
s=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-s=
erif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span=
 style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D=
'>my $conn =3D XMLRPC::Lite-&gt;proxy('https://vacslp01spacewalk.cucbc.com/=
cobbler_api');<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'fon=
t-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>my $token =
=3D $conn-&gt;login($username, $password)-&gt;result();<o:p></o:p></span></=
p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri=
","sans-serif";color:#1F497D'>my $object =3D $conn-&gt;new_system($token)-&=
gt;result();<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-=
size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>print &quot;n=
ew system id is $object\n&quot;;<o:p></o:p></span></p><p class=3DMsoNormal>=
<span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1=
F497D'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><span style=3D'font=
-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>my $ret;<o:p=
></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font=
-family:"Calibri","sans-serif";color:#1F497D'>$ret =3D $conn-&gt;modify_sys=
tem($object, 'name', $name, $token)-&gt;result();<o:p></o:p></span></p><p c=
lass=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","san=
s-serif";color:#1F497D'>print &quot;modify name:&quot; . $ret . &quot;\n&qu=
ot;;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.=
0pt;font-family:"Calibri","sans-serif";color:#1F497D'>$ret =3D $conn-&gt;mo=
dify_system($object, 'hostname', $name, $token)-&gt;result();<o:p></o:p></s=
pan></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"C=
alibri","sans-serif";color:#1F497D'>print &quot;modify hostname: &quot; . $=
ret . &quot;\n&quot;;<o:p></o:p></span></p><p class=3DMsoNormal><span style=
=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>$ret=
 =3D $conn-&gt;save_system($object, $token);<o:p></o:p></span></p><p class=
=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-se=
rif";color:#1F497D'>print &quot;save system: &quot; . $ret . &quot;\n&quot;=
;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt=
;font-family:"Calibri","sans-serif";color:#1F497D'>$ret =3D $conn-&gt;sync(=
$token)-&gt;result();<o:p></o:p></span></p><p class=3DMsoNormal><span style=
=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>prin=
t &quot;sync:&quot; . $ret . &quot;\n&quot;;<o:p></o:p></span></p><p class=
=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-se=
rif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=3DMsoNormal><b><sp=
an style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span=
></b><span style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'> co=
bbler-bounces at lists.fedorahosted.org [mailto:cobbler-bounces at lists.fedoraho=
sted.org] <b>On Behalf Of </b>James Clendenan<br><b>Sent:</b> Thursday, Nov=
ember 08, 2012 5:32 PM<br><b>To:</b> cobbler mailing list<br><b>Subject:</b=
> Re: [cobbler] Problems with writing systems through the XMLRPC API using =
perl XML::RPC or XMLRPC::Lite<o:p></o:p></span></p><p class=3DMsoNormal><o:=
p>&nbsp;</o:p></p><p class=3DMsoNormal style=3D'margin-bottom:12.0pt'>I'm n=
ot going to be much help on this, but one thought I would have is that you'=
re not checking the return of the result call, which could be trying to tel=
l you something about an error.&nbsp; I do recall when trying to do a pytho=
n interface to do similar, it was usually that I was missing one of the req=
uired host fields.<br><br>You should also take a look at the test cases for=
 the webui as it also uses the xmlrpc interface for it's work.<br><br>James=
<o:p></o:p></p><div><p class=3DMsoNormal>On Thu, Nov 8, 2012 at 4:10 PM, Ja=
son Barlow &lt;<a href=3D"mailto:jbarlow at central1.com" target=3D"_blank">jb=
arlow at central1.com</a>&gt; wrote:<o:p></o:p></p><div><div><p class=3DMsoNor=
mal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I&#8217;m =
trying to create a new system profile using perl through the XMLRPC API.<o:=
p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margi=
n-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-m=
argin-top-alt:auto;mso-margin-bottom-alt:auto'>Things work great using pyth=
on, but when I try to use either of the above perl interfaces, I&#8217;m no=
t able to actually write any of the new objects I&#8217;ve created:<o:p></o=
:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bot=
tom-alt:auto'>&nbsp;<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin=
-top-alt:auto;mso-margin-bottom-alt:auto'>Reading items works a charm, and =
it looks like the calls themselves are succeeding, but the host never shows=
 up in a:<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:au=
to;mso-margin-bottom-alt:auto'>#[root at spacewalk cobbler]# cobbler system li=
st | grep test<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-a=
lt:auto;mso-margin-bottom-alt:auto'>#<o:p></o:p></p><p class=3DMsoNormal st=
yle=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p=
></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-botto=
m-alt:auto'>I&#8217;m wondering what&#8217;s going wrong here; am I not aut=
henticating properly?<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margi=
n-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=3D=
MsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I&#8=
217;ve tried using both XML::RPC and XMLRPC::Lite, and get similar results,=
 where reads work fine, but nothing actually &#8216;sticks&#8217;<o:p></o:p=
></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-botto=
m-alt:auto'>&nbsp;<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-t=
op-alt:auto;mso-margin-bottom-alt:auto'>Here&#8217;s the script that I&#821=
7;m using for XMLRPC::Lite<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-=
margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p cla=
ss=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'=
>#!/usr/bin/perl<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top=
-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=3DMsoNo=
rmal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>use stric=
t;<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-=
margin-bottom-alt:auto'>use warnings;<o:p></o:p></p><p class=3DMsoNormal st=
yle=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>use XMLRPC::Lite=
;<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-m=
argin-bottom-alt:auto'>use Data::Dumper;<o:p></o:p></p><p class=3DMsoNormal=
 style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></=
o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto'>my $username =3D 'api-user';<o:p></o:p></p><p class=3DMsoNor=
mal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>my $passwo=
rd =3D 'sapi-user';<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-=
top-alt:auto;mso-margin-bottom-alt:auto'>my $proto =3D 'http://';<o:p></o:p=
></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-botto=
m-alt:auto'>my $servername =3D 'spacewak';<o:p></o:p></p><p class=3DMsoNorm=
al style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>my $api =3D=
 '/cobbler_api';<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top=
-alt:auto;mso-margin-bottom-alt:auto'>my $url =3D $proto . $servername . $a=
pi;<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso=
-margin-bottom-alt:auto'>my $name =3D 'vacsld01test';<o:p></o:p></p><p clas=
s=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>=
&nbsp;<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;=
mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=3DMsoNormal style=
=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>my $conn =3D XMLRPC=
::Lite-&gt;proxy('<a href=3D"https://vacslp01spacewalk.cucbc.com/cobbler_ap=
i'" target=3D"_blank">https://vacslp01spacewalk.cucbc.com/cobbler_api'</a>)=
;<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-m=
argin-bottom-alt:auto'>my $token =3D $conn-&gt;login($username, $password)-=
&gt;result();<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-al=
t:auto;mso-margin-bottom-alt:auto'>my $object =3D $conn-&gt;new_system($tok=
en)-&gt;result();<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-to=
p-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=3DMsoN=
ormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>$conn-&g=
t;modify_system($object, 'name', $name, $token)-&gt;result();<o:p></o:p></p=
><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-al=
t:auto'>$conn-&gt;modify_system($object, 'hostname', $name, $token)-&gt;res=
ult();<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;=
mso-margin-bottom-alt:auto'>$conn-&gt;save_system($object, $token)-&gt;resu=
lt();<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;m=
so-margin-bottom-alt:auto'>$conn-&gt;sync($token)-&gt;result();<o:p></o:p><=
/p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-=
alt:auto'>&nbsp;<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top=
-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=3DMsoNo=
rmal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>/var/log/=
cobbler/cobbler.log has:<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-ma=
rgin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=
=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>T=
hu Nov&nbsp; 8 16:03:46 2012 - INFO | authenticate; ['api-user', True]<o:p>=
</o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-=
bottom-alt:auto'>Thu Nov&nbsp; 8 16:03:46 2012 - INFO | REMOTE new_item(sys=
tem); user(api-user)<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin=
-top-alt:auto;mso-margin-bottom-alt:auto'>Thu Nov&nbsp; 8 16:03:46 2012 - D=
EBUG | authorize; ['api-user', 'new_system', None, None, True]<o:p></o:p></=
p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto'>Thu Nov&nbsp; 8 16:03:46 2012 - DEBUG | REMOTE api-user authorizat=
ion result: True; user(?)<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-m=
argin-top-alt:auto;mso-margin-bottom-alt:auto'>Thu Nov&nbsp; 8 16:03:46 201=
2 - INFO | REMOTE modify_item(system); user(api-user); object_id(___NEW___s=
ystem::o0X5NLQrLsh9rXGhtvbuts56aTY6zb4JfQ=3D=3D); attribute(name)<o:p></o:p=
></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-botto=
m-alt:auto'>Thu Nov&nbsp; 8 16:03:46 2012 - DEBUG | authorize; ['api-user',=
 'modify_system', &lt;cobbler.item_system.System instance at 0x14350560&gt;=
, 'name', True]<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-=
alt:auto;mso-margin-bottom-alt:auto'>Thu Nov&nbsp; 8 16:03:46 2012 - DEBUG =
| REMOTE api-user authorization result: True; user(?)<o:p></o:p></p><p clas=
s=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>=
Thu Nov&nbsp; 8 16:03:46 2012 - INFO | REMOTE modify_item(system); user(api=
-user); object_id(___NEW___system::o0X5NLQrLsh9rXGhtvbuts56aTY6zb4JfQ=3D=3D=
); attribute(hostname)<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-marg=
in-top-alt:auto;mso-margin-bottom-alt:auto'>Thu Nov&nbsp; 8 16:03:46 2012 -=
 DEBUG | authorize; ['api-user', 'modify_system', &lt;cobbler.item_system.S=
ystem instance at 0x14350560&gt;, 'hostname', True]<o:p></o:p></p><p class=
=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>T=
hu Nov&nbsp; 8 16:03:46 2012 - DEBUG | REMOTE api-user authorization result=
: True; user(?)<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-=
alt:auto;mso-margin-bottom-alt:auto'>Thu Nov&nbsp; 8 16:03:46 2012 - INFO |=
 REMOTE save_item(system); user(api-user); object_id(___NEW___system::o0X5N=
LQrLsh9rXGhtvbuts56aTY6zb4JfQ=3D=3D)<o:p></o:p></p><p class=3DMsoNormal sty=
le=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thu Nov&nbsp; 8 1=
6:03:46 2012 - DEBUG | authorize; ['api-user', 'save_system', &lt;cobbler.i=
tem_system.System instance at 0x14350560&gt;, None, True]<o:p></o:p></p><p =
class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:au=
to'>Thu Nov&nbsp; 8 16:03:46 2012 - DEBUG | REMOTE api-user authorization r=
esult: True; user(?)<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin=
-top-alt:auto;mso-margin-bottom-alt:auto'>Thu Nov&nbsp; 8 16:03:46 2012 - I=
NFO | add_item(system); ['vacsld01test']<o:p></o:p></p><p class=3DMsoNormal=
 style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thu Nov&nbsp;=
 8 16:03:46 2012 - DEBUG | get_items; ['system']<o:p></o:p></p><p class=3DM=
soNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thu N=
ov&nbsp; 8 16:03:46 2012 - INFO | REMOTE sync; user(api-user)<o:p></o:p></p=
><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-al=
t:auto'>Thu Nov&nbsp; 8 16:03:46 2012 - DEBUG | authorize; ['api-user', 'sy=
nc', None, None, True]<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-marg=
in-top-alt:auto;mso-margin-bottom-alt:auto'>Thu Nov&nbsp; 8 16:03:46 2012 -=
 DEBUG | REMOTE api-user authorization result: True; user(?)<o:p></o:p></p>=
<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto'>Thu Nov&nbsp; 8 16:03:46 2012 - INFO | sync<o:p></o:p></p><p class=
=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>T=
hu Nov&nbsp; 8 16:03:46 2012 - INFO | running pre-sync triggers<o:p></o:p><=
/p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-=
alt:auto'>Thu Nov&nbsp; 8 16:03:46 2012 - INFO | cleaning trees<o:p></o:p><=
/p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-=
alt:auto'>&nbsp;<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top=
-alt:auto;mso-margin-bottom-alt:auto'>I&#8217;m using:<o:p></o:p></p><p cla=
ss=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'=
>&nbsp;<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto=
;mso-margin-bottom-alt:auto'>cobbler2-2.0.11-4.el5 ( CentOS 5.8)<o:p></o:p>=
</p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto'>perl v5.10.1<o:p></o:p></p><p class=3DMsoNormal style=3D'mso-mar=
gin-top-alt:auto;mso-margin-bottom-alt:auto'>XMLRPC::Lite 0.715<o:p></o:p><=
/p></div></div><p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><br>____=
___________________________________________<br>cobbler mailing list<br><a h=
ref=3D"mailto:cobbler at lists.fedorahosted.org">cobbler at lists.fedorahosted.or=
g</a><br><a href=3D"https://lists.fedorahosted.org/mailman/listinfo/cobbler=
" target=3D"_blank">https://lists.fedorahosted.org/mailman/listinfo/cobbler=
</a><o:p></o:p></p></div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div></=
body></html>=

--_000_4470426D5F017A46BE3A83292FD5D2B54AB6887C3AEVS1csadcentr_--


More information about the cobbler mailing list