FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 04-30-2008, 08:42 AM
"Eamonn Walsh"
 
Default Cobbler API - Mac registration problem

Hi Guys,

Doing some work with the cobbler api and getting the fallowing error

Traceback (most recent call last):
* File "rpc-cobbler-test", line 20, in ?
*** remote.modify_system(system_id, 'interfaces : mac_address', 'FF:EED:CC:BB:AA', token)


* File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in __call__
*** return self.__send(self.__name, args)
* File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request

*** verbose=self.__verbose

* File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
*** return self._parse_response(h.getfile(), sock)
* File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in _parse_response
*** return u.close()


* File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
*** raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'object has no method: mac'">



Line of code causing this problem:

remote.modify_system(sys_id, 'mac', 'AA:BB:CCD:EE:FF', token)

Any ideas? Using cobbler 0.8.3-3.el5

Thanks,

Eamonn
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 04-30-2008, 11:10 AM
Pablo Iranzo Gómez
 
Default Cobbler API - Mac registration problem

Is it possible to have the script to play with it?

Will try to check how this works and possible usages

Thanks!
Pablo

El mié, 30-04-2008 a las 09:42 +0100, Eamonn Walsh escribió:
> Hi Guys,
>
> Doing some work with the cobbler api and getting the fallowing error
>
> Traceback (most recent call last):
> File "rpc-cobbler-test", line 20, in ?
> remote.modify_system(system_id, 'interfaces : mac_address',
> 'FF:EED:CC:BB:AA', token)
> File "/usr/lib/python2.4/xmlrpclib
> .py", line 1096, in __call__
> return self.__send(self.__name, args)
> File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
> verbose=self.__verbose
> File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
> return self._parse_response(h.getfile(), sock)
> File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in
> _parse_response
> return u.close()
> File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
> raise Fault(**self._stack[0])
> xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'object has no
> method: mac'">
>
> Line of code causing this problem:
>
> remote.modify_system(sys_id, 'mac', 'AA:BB:CCD:EE:FF', token)
>
> Any ideas? Using cobbler 0.8.3-3.el5
>
> Thanks,
>
> Eamonn
> _______________________________________________
> et-mgmt-tools mailing list
> et-mgmt-tools@redhat.com
> https://www.redhat.com/mailman/listinfo/et-mgmt-tools
--

Pablo Iranzo Gómez (Pablo.Iranzo@redhat.com)
RHCE/Global Profesional Services Consultant Spain
Phone: +34 645 01 01 49 (CET/CEST)
GnuPG KeyID: 0xFAD3CF0D
---
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta 3ºD, 28016 Madrid, Spain
Dirección Registrada: Red Hat S.L., C/ Velazquez 63, Madrid 28001, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 04-30-2008, 11:24 AM
"Eamonn Walsh"
 
Default Cobbler API - Mac registration problem

Its just a test script at the moment, I want to see what it can do

system_id = remote.new_system(token)
remote.modify_system(system_id,'name', 'Imatest2',token)
remote.modify_system(system_id,'profile', 'Testing',token)

remote.modify_system(system_id, 'mac', 'FF:EED:CC:BB:AA',token)
remote.save_system(system_id,token)

I think the problem is because the 'mac' key is in a nested list, not sure though.


On Wed, Apr 30, 2008 at 12:10 PM, Pablo Iranzo Gómez <Pablo.Iranzo@redhat.com> wrote:



* * * *Is it possible to have the script to play with it?



* * * *Will try to check how this works and possible usages



* * * *Thanks!

* * * *Pablo



El mié, 30-04-2008 a las 09:42 +0100, Eamonn Walsh escribió:

> Hi Guys,

>

> Doing some work with the cobbler api and getting the fallowing error

>

> Traceback (most recent call last):

> * File "rpc-cobbler-test", line 20, in ?

> * * remote.modify_system(system_id, 'interfaces : mac_address',

> 'FF:EED:CC:BB:AA', token)

> * File "/usr/lib/python2.4/xmlrpclib

> .py", line 1096, in __call__

> * * return self.__send(self.__name, args)

> * File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request

> * * verbose=self.__verbose

> * File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request

> * * return self._parse_response(h.getfile(), sock)

> * File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in

> _parse_response

> * * return u.close()

> * File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close

> * * raise Fault(**self._stack[0])

> xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'object has no

> method: mac'">

>

> Line of code causing this problem:

>

> remote.modify_system(sys_id, 'mac', 'AA:BB:CCD:EE:FF', token)

>

> Any ideas? Using cobbler 0.8.3-3.el5

>

> Thanks,

>

> Eamonn

> _______________________________________________

> et-mgmt-tools mailing list

> et-mgmt-tools@redhat.com

> https://www.redhat.com/mailman/listinfo/et-mgmt-tools

--



Pablo Iranzo Gómez (Pablo.Iranzo@redhat.com)

RHCE/Global Profesional Services Consultant Spain

Phone: +34 645 01 01 49 (CET/CEST)

GnuPG KeyID: 0xFAD3CF0D

---

Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta 3ºD, 28016 Madrid, Spain

Dirección Registrada: Red Hat S.L., C/ Velazquez 63, Madrid 28001, Spain

Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941


_______________________________________________

et-mgmt-tools mailing list

et-mgmt-tools@redhat.com

https://www.redhat.com/mailman/listinfo/et-mgmt-tools


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 04-30-2008, 11:32 AM
Michael DeHaan
 
Default Cobbler API - Mac registration problem

Pablo Iranzo Gmez wrote:

Is it possible to have the script to play with it?

Will try to check how this works and possible usages

Thanks!
Pablo




Mac registration has been revamped. It works /very/ well in 0.9.X (the
devel branch) at this point.
There is a new registration enabling option in settings to turn on but
it works a lot more smoothly.


If you would like to play with the devel version before we have a test
release, see the instructions at


https://fedorahosted.org/cobbler/wiki/QuickDevelRpmBuildGuide

We will have a test release probably next week with source rpms but
there's no reason you couldn't try it

now...


El mi, 30-04-2008 a las 09:42 +0100, Eamonn Walsh escribi:


Hi Guys,

Doing some work with the cobbler api and getting the fallowing error

Traceback (most recent call last):
File "rpc-cobbler-test", line 20, in ?
remote.modify_system(system_id, 'interfaces : mac_address',
'FF:EED:CC:BB:AA', token)
File "/usr/lib/python2.4/xmlrpclib
.py", line 1096, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
verbose=self.__verbose
File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
return self._parse_response(h.getfile(), sock)
File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in
_parse_response
return u.close()
File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'object has no
method: mac'">

Line of code causing this problem:

remote.modify_system(sys_id, 'mac', 'AA:BB:CCD:EE:FF', token)

Any ideas? Using cobbler 0.8.3-3.el5

Thanks,

Eamonn
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

------------------------------------------------------------------------


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 04-30-2008, 11:38 AM
Michael DeHaan
 
Default Cobbler API - Mac registration problem

Eamonn Walsh wrote:

Its just a test script at the moment, I want to see what it can do

system_id = remote.new_system(token)
remote.modify_system(system_id,'name', 'Imatest2',token)
remote.modify_system(system_id,'profile', 'Testing',token)
remote.modify_system(system_id, 'mac', 'FF:EED:CC:BB:AA',token)
remote.save_system(system_id,token)

I think the problem is because the 'mac' key is in a nested list, not
sure though.


Ah, this is your script? Glad to see more interest in API hacking!

Yes, I did some work to add this recently. Definitely check out the
devel branch. If you are interested in the code, see 'remote.py' and
'services.py'.
The idea was to consolidate all of the cgi-bin stuff on mod_python to
simplify things. All of the mod_python code ('services.py')
effectively sends requests
down to cobblerd via XMLRPC ('remote.py'). Since this relies on
kssendmac in the kernel options line, you won't see results from running
"wget", but if you request those kickstart URLs from Anaconda
registration (if enabled in settings via the new option) will occur.


It has some security features in that it will not add a system if mac is
already in the "database" and works by detecting the mac of the system
when they request the kickstart file from the mod python kickstart
generator (kickstarts are no longer statically generated on the filesystem).


--Michael




On Wed, Apr 30, 2008 at 12:10 PM, Pablo Iranzo Gómez
<Pablo.Iranzo@redhat.com <mailto:Pablo.Iranzo@redhat.com>> wrote:



Is it possible to have the script to play with it?

Will try to check how this works and possible usages

Thanks!
Pablo

El mié, 30-04-2008 a las 09:42 +0100, Eamonn Walsh escribió:
> Hi Guys,
>
> Doing some work with the cobbler api and getting the fallowing error
>
> Traceback (most recent call last):
> File "rpc-cobbler-test", line 20, in ?
> remote.modify_system(system_id, 'interfaces : mac_address',
> 'FF:EED:CC:BB:AA', token)
> File "/usr/lib/python2.4/xmlrpclib
> .py", line 1096, in __call__
> return self.__send(self.__name, args)
> File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
> verbose=self.__verbose
> File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
> return self._parse_response(h.getfile(), sock)
> File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in
> _parse_response
> return u.close()
> File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
> raise Fault(**self._stack[0])
> xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'object has no
> method: mac'">
>
> Line of code causing this problem:
>
> remote.modify_system(sys_id, 'mac', 'AA:BB:CCD:EE:FF', token)
>
> Any ideas? Using cobbler 0.8.3-3.el5
>
> Thanks,
>
> Eamonn
> _______________________________________________
> et-mgmt-tools mailing list
> et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>
> https://www.redhat.com/mailman/listinfo/et-mgmt-tools
--

Pablo Iranzo Gómez (Pablo.Iranzo@redhat.com
<mailto:Pablo.Iranzo@redhat.com>)
RHCE/Global Profesional Services Consultant Spain
Phone: +34 645 01 01 49 (CET/CEST)
GnuPG KeyID: 0xFAD3CF0D
---
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3,
planta 3ºD, 28016 Madrid, Spain
Dirección Registrada: Red Hat S.L., C/ Velazquez 63, Madrid 28001,
Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


------------------------------------------------------------------------

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 04-30-2008, 11:41 AM
Michael DeHaan
 
Default Cobbler API - Mac registration problem

Michael DeHaan wrote:

Eamonn Walsh wrote:

Its just a test script at the moment, I want to see what it can do

system_id = remote.new_system(token)
remote.modify_system(system_id,'name', 'Imatest2',token)
remote.modify_system(system_id,'profile', 'Testing',token)
remote.modify_system(system_id, 'mac', 'FF:EED:CC:BB:AA',token)
remote.save_system(system_id,token)

I think the problem is because the 'mac' key is in a nested list, not
sure though.


Ah, this is your script? Glad to see more interest in API hacking!
Yes, I did some work to add this recently. Definitely check out the
devel branch. If you are interested in the code, see 'remote.py'
and 'services.py'.
The idea was to consolidate all of the cgi-bin stuff on mod_python to
simplify things. All of the mod_python code ('services.py')
effectively sends requests
down to cobblerd via XMLRPC ('remote.py'). Since this relies on
kssendmac in the kernel options line, you won't see results from
running "wget", but if you request those kickstart URLs from Anaconda
registration (if enabled in settings via the new option) will occur.


It has some security features in that it will not add a system if mac
is already in the "database" and works by detecting the mac of the system
when they request the kickstart file from the mod python kickstart
generator (kickstarts are no longer statically generated on the
filesystem).


--Michael


In the interest of completeness, the issue is that cobbler now suppports
multiple network interfaces. So your script has to use the API to
modify network interfaces, which is slightly varied from the above.
See remote.py on the devel branch for how that is done. The WebUI,
which is written against the same XMLRPC interface, is also a good
reference. (cobbler/web/CobblerWeb.py)





On Wed, Apr 30, 2008 at 12:10 PM, Pablo Iranzo Gómez
<Pablo.Iranzo@redhat.com <mailto:Pablo.Iranzo@redhat.com>> wrote:



Is it possible to have the script to play with it?

Will try to check how this works and possible usages

Thanks!
Pablo

El mié, 30-04-2008 a las 09:42 +0100, Eamonn Walsh escribió:
> Hi Guys,
>
> Doing some work with the cobbler api and getting the fallowing
error

>
> Traceback (most recent call last):
> File "rpc-cobbler-test", line 20, in ?
> remote.modify_system(system_id, 'interfaces : mac_address',
> 'FF:EED:CC:BB:AA', token)
> File "/usr/lib/python2.4/xmlrpclib
> .py", line 1096, in __call__
> return self.__send(self.__name, args)
> File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request
> verbose=self.__verbose
> File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request
> return self._parse_response(h.getfile(), sock)
> File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in
> _parse_response
> return u.close()
> File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
> raise Fault(**self._stack[0])
> xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'object has no
> method: mac'">
>
> Line of code causing this problem:
>
> remote.modify_system(sys_id, 'mac', 'AA:BB:CCD:EE:FF', token)
>
> Any ideas? Using cobbler 0.8.3-3.el5
>
> Thanks,
>
> Eamonn
> _______________________________________________
> et-mgmt-tools mailing list
> et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>
> https://www.redhat.com/mailman/listinfo/et-mgmt-tools
--

Pablo Iranzo Gómez (Pablo.Iranzo@redhat.com
<mailto:Pablo.Iranzo@redhat.com>)
RHCE/Global Profesional Services Consultant Spain
Phone: +34 645 01 01 49 (CET/CEST)
GnuPG KeyID: 0xFAD3CF0D
---
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3,
planta 3ºD, 28016 Madrid, Spain
Dirección Registrada: Red Hat S.L., C/ Velazquez 63, Madrid 28001,
Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


------------------------------------------------------------------------

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 04-30-2008, 11:46 AM
"Eamonn Walsh"
 
Default Cobbler API - Mac registration problem

What I'm hoping to achieve here, is to register the system with cobbler on first boot, I'm planning on plugging it into a script that runs at first boot anyway. Since auto reg isn't part of cobbler 0.8.3-3.el5, I'm hoping to use this as a work around.


It works fine registering the system name and profile, but falls over when I try and register the mac. Will have a snoop around in the code..

On Wed, Apr 30, 2008 at 12:41 PM, Michael DeHaan <mdehaan@redhat.com> wrote:

Michael DeHaan wrote:


Eamonn Walsh wrote:


Its just a test script at the moment, I want to see what it can do



system_id = remote.new_system(token)

remote.modify_system(system_id,'name', 'Imatest2',token)

remote.modify_system(system_id,'profile', 'Testing',token)

remote.modify_system(system_id, 'mac', 'FF:EED:CC:BB:AA',token)

remote.save_system(system_id,token)



I think the problem is because the 'mac' key is in a nested list, not sure though.




Ah, this is your script? * Glad to see more interest in API hacking!

Yes, I did some work to add this recently. * Definitely check out the devel branch. * *If you are interested in the code, see 'remote.py' and 'services.py'.

The idea was to consolidate all of the cgi-bin stuff on mod_python to simplify things. * *All of the mod_python code ('services.py') effectively sends requests

down to cobblerd via XMLRPC ('remote.py'). * *Since this relies on kssendmac in the kernel options line, you won't see results from running "wget", but if you request those kickstart URLs from Anaconda registration (if enabled in settings via the new option) will occur.




It has some security features in that it will not add a system if mac is already in the "database" and works by detecting the mac of the system

when they request the kickstart file from the mod python kickstart generator (kickstarts are no longer statically generated on the filesystem).



--Michael




In the interest of completeness, the issue is that cobbler now suppports multiple network interfaces. *So your script has to use the API to modify network interfaces, which is slightly varied from the above. * See remote.py on the devel branch for how that is done. * The WebUI, which is written against the same XMLRPC interface, is also a good reference. *(cobbler/web/CobblerWeb.py)










On Wed, Apr 30, 2008 at 12:10 PM, Pablo Iranzo Gómez <Pablo.Iranzo@redhat.com <mailto:Pablo.Iranzo@redhat.com>> wrote:






* * * * * Is it possible to have the script to play with it?



* * * * * Will try to check how this works and possible usages



* * * * * Thanks!

* * * * * Pablo



* *El mié, 30-04-2008 a las 09:42 +0100, Eamonn Walsh escribió:

* *> Hi Guys,

* *>

* *> Doing some work with the cobbler api and getting the fallowing error

* *>

* *> Traceback (most recent call last):

* *> * File "rpc-cobbler-test", line 20, in ?

* *> * * remote.modify_system(system_id, 'interfaces : mac_address',

* *> 'FF:EED:CC:BB:AA', token)

* *> * File "/usr/lib/python2.4/xmlrpclib

* *> .py", line 1096, in __call__

* *> * * return self.__send(self.__name, args)

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request

* *> * * verbose=self.__verbose

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request

* *> * * return self._parse_response(h.getfile(), sock)

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in

* *> _parse_response

* *> * * return u.close()

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close

* *> * * raise Fault(**self._stack[0])

* *> xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'object has no

* *> method: mac'">

* *>

* *> Line of code causing this problem:

* *>

* *> remote.modify_system(sys_id, 'mac', 'AA:BB:CCD:EE:FF', token)

* *>

* *> Any ideas? Using cobbler 0.8.3-3.el5

* *>

* *> Thanks,

* *>

* *> Eamonn

* *> _______________________________________________

* *> et-mgmt-tools mailing list

* *> et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>

* *> https://www.redhat.com/mailman/listinfo/et-mgmt-tools

* *--



* *Pablo Iranzo Gómez (Pablo.Iranzo@redhat.com

* *<mailto:Pablo.Iranzo@redhat.com>)

* *RHCE/Global Profesional Services Consultant Spain

* *Phone: +34 645 01 01 49 (CET/CEST)

* *GnuPG KeyID: 0xFAD3CF0D

* *---

* *Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3,

* *planta 3ºD, 28016 Madrid, Spain

* *Dirección Registrada: Red Hat S.L., C/ Velazquez 63, Madrid 28001,

* *Spain

* *Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941



* *_______________________________________________

* *et-mgmt-tools mailing list

* *et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>

* *https://www.redhat.com/mailman/listinfo/et-mgmt-tools





------------------------------------------------------------------------



_______________________________________________

et-mgmt-tools mailing list

et-mgmt-tools@redhat.com

https://www.redhat.com/mailman/listinfo/et-mgmt-tools




_______________________________________________

et-mgmt-tools mailing list

et-mgmt-tools@redhat.com

https://www.redhat.com/mailman/listinfo/et-mgmt-tools




_______________________________________________

et-mgmt-tools mailing list

et-mgmt-tools@redhat.com

https://www.redhat.com/mailman/listinfo/et-mgmt-tools



_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 04-30-2008, 12:54 PM
"Eamonn Walsh"
 
Default Cobbler API - Mac registration problem

Just a question actually, has anyone had any success using the api to register systems with cobbler?



On Wed, Apr 30, 2008 at 12:46 PM, Eamonn Walsh <eamonn.walsh@gmail.com> wrote:

What I'm hoping to achieve here, is to register the system with cobbler on first boot, I'm planning on plugging it into a script that runs at first boot anyway. Since auto reg isn't part of cobbler 0.8.3-3.el5, I'm hoping to use this as a work around.



It works fine registering the system name and profile, but falls over when I try and register the mac. Will have a snoop around in the code..

On Wed, Apr 30, 2008 at 12:41 PM, Michael DeHaan <mdehaan@redhat.com> wrote:


Michael DeHaan wrote:


Eamonn Walsh wrote:


Its just a test script at the moment, I want to see what it can do



system_id = remote.new_system(token)

remote.modify_system(system_id,'name', 'Imatest2',token)

remote.modify_system(system_id,'profile', 'Testing',token)

remote.modify_system(system_id, 'mac', 'FF:EED:CC:BB:AA',token)

remote.save_system(system_id,token)



I think the problem is because the 'mac' key is in a nested list, not sure though.




Ah, this is your script? * Glad to see more interest in API hacking!

Yes, I did some work to add this recently. * Definitely check out the devel branch. * *If you are interested in the code, see 'remote.py' and 'services.py'.

The idea was to consolidate all of the cgi-bin stuff on mod_python to simplify things. * *All of the mod_python code ('services.py') effectively sends requests

down to cobblerd via XMLRPC ('remote.py'). * *Since this relies on kssendmac in the kernel options line, you won't see results from running "wget", but if you request those kickstart URLs from Anaconda registration (if enabled in settings via the new option) will occur.





It has some security features in that it will not add a system if mac is already in the "database" and works by detecting the mac of the system

when they request the kickstart file from the mod python kickstart generator (kickstarts are no longer statically generated on the filesystem).



--Michael




In the interest of completeness, the issue is that cobbler now suppports multiple network interfaces. *So your script has to use the API to modify network interfaces, which is slightly varied from the above. * See remote.py on the devel branch for how that is done. * The WebUI, which is written against the same XMLRPC interface, is also a good reference. *(cobbler/web/CobblerWeb.py)











On Wed, Apr 30, 2008 at 12:10 PM, Pablo Iranzo Gómez <Pablo.Iranzo@redhat.com <mailto:Pablo.Iranzo@redhat.com>> wrote:







* * * * * Is it possible to have the script to play with it?



* * * * * Will try to check how this works and possible usages



* * * * * Thanks!

* * * * * Pablo



* *El mié, 30-04-2008 a las 09:42 +0100, Eamonn Walsh escribió:

* *> Hi Guys,

* *>

* *> Doing some work with the cobbler api and getting the fallowing error

* *>

* *> Traceback (most recent call last):

* *> * File "rpc-cobbler-test", line 20, in ?

* *> * * remote.modify_system(system_id, 'interfaces : mac_address',

* *> 'FF:EED:CC:BB:AA', token)

* *> * File "/usr/lib/python2.4/xmlrpclib

* *> .py", line 1096, in __call__

* *> * * return self.__send(self.__name, args)

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request

* *> * * verbose=self.__verbose

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request

* *> * * return self._parse_response(h.getfile(), sock)

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in

* *> _parse_response

* *> * * return u.close()

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close

* *> * * raise Fault(**self._stack[0])

* *> xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'object has no

* *> method: mac'">

* *>

* *> Line of code causing this problem:

* *>

* *> remote.modify_system(sys_id, 'mac', 'AA:BB:CCD:EE:FF', token)

* *>

* *> Any ideas? Using cobbler 0.8.3-3.el5

* *>

* *> Thanks,

* *>

* *> Eamonn

* *> _______________________________________________

* *> et-mgmt-tools mailing list

* *> et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>

* *> https://www.redhat.com/mailman/listinfo/et-mgmt-tools

* *--



* *Pablo Iranzo Gómez (Pablo.Iranzo@redhat.com

* *<mailto:Pablo.Iranzo@redhat.com>)

* *RHCE/Global Profesional Services Consultant Spain

* *Phone: +34 645 01 01 49 (CET/CEST)

* *GnuPG KeyID: 0xFAD3CF0D

* *---

* *Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3,

* *planta 3ºD, 28016 Madrid, Spain

* *Dirección Registrada: Red Hat S.L., C/ Velazquez 63, Madrid 28001,

* *Spain

* *Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941



* *_______________________________________________

* *et-mgmt-tools mailing list

* *et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>

* *https://www.redhat.com/mailman/listinfo/et-mgmt-tools





------------------------------------------------------------------------



_______________________________________________

et-mgmt-tools mailing list

et-mgmt-tools@redhat.com

https://www.redhat.com/mailman/listinfo/et-mgmt-tools




_______________________________________________

et-mgmt-tools mailing list

et-mgmt-tools@redhat.com

https://www.redhat.com/mailman/listinfo/et-mgmt-tools




_______________________________________________

et-mgmt-tools mailing list

et-mgmt-tools@redhat.com

https://www.redhat.com/mailman/listinfo/et-mgmt-tools





_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 04-30-2008, 01:29 PM
"Eamonn Walsh"
 
Default Cobbler API - Mac registration problem

Just realised I'm actually talking about, Read - Write XMLRPC

On Wed, Apr 30, 2008 at 1:54 PM, Eamonn Walsh <eamonn.walsh@gmail.com> wrote:

Just a question actually, has anyone had any success using the api to register systems with cobbler?




On Wed, Apr 30, 2008 at 12:46 PM, Eamonn Walsh <eamonn.walsh@gmail.com> wrote:

What I'm hoping to achieve here, is to register the system with cobbler on first boot, I'm planning on plugging it into a script that runs at first boot anyway. Since auto reg isn't part of cobbler 0.8.3-3.el5, I'm hoping to use this as a work around.




It works fine registering the system name and profile, but falls over when I try and register the mac. Will have a snoop around in the code..

On Wed, Apr 30, 2008 at 12:41 PM, Michael DeHaan <mdehaan@redhat.com> wrote:



Michael DeHaan wrote:


Eamonn Walsh wrote:


Its just a test script at the moment, I want to see what it can do



system_id = remote.new_system(token)

remote.modify_system(system_id,'name', 'Imatest2',token)

remote.modify_system(system_id,'profile', 'Testing',token)

remote.modify_system(system_id, 'mac', 'FF:EED:CC:BB:AA',token)

remote.save_system(system_id,token)



I think the problem is because the 'mac' key is in a nested list, not sure though.




Ah, this is your script? * Glad to see more interest in API hacking!

Yes, I did some work to add this recently. * Definitely check out the devel branch. * *If you are interested in the code, see 'remote.py' and 'services.py'.

The idea was to consolidate all of the cgi-bin stuff on mod_python to simplify things. * *All of the mod_python code ('services.py') effectively sends requests

down to cobblerd via XMLRPC ('remote.py'). * *Since this relies on kssendmac in the kernel options line, you won't see results from running "wget", but if you request those kickstart URLs from Anaconda registration (if enabled in settings via the new option) will occur.






It has some security features in that it will not add a system if mac is already in the "database" and works by detecting the mac of the system

when they request the kickstart file from the mod python kickstart generator (kickstarts are no longer statically generated on the filesystem).



--Michael




In the interest of completeness, the issue is that cobbler now suppports multiple network interfaces. *So your script has to use the API to modify network interfaces, which is slightly varied from the above. * See remote.py on the devel branch for how that is done. * The WebUI, which is written against the same XMLRPC interface, is also a good reference. *(cobbler/web/CobblerWeb.py)












On Wed, Apr 30, 2008 at 12:10 PM, Pablo Iranzo Gómez <Pablo.Iranzo@redhat.com <mailto:Pablo.Iranzo@redhat.com>> wrote:








* * * * * Is it possible to have the script to play with it?



* * * * * Will try to check how this works and possible usages



* * * * * Thanks!

* * * * * Pablo



* *El mié, 30-04-2008 a las 09:42 +0100, Eamonn Walsh escribió:

* *> Hi Guys,

* *>

* *> Doing some work with the cobbler api and getting the fallowing error

* *>

* *> Traceback (most recent call last):

* *> * File "rpc-cobbler-test", line 20, in ?

* *> * * remote.modify_system(system_id, 'interfaces : mac_address',

* *> 'FF:EED:CC:BB:AA', token)

* *> * File "/usr/lib/python2.4/xmlrpclib

* *> .py", line 1096, in __call__

* *> * * return self.__send(self.__name, args)

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in __request

* *> * * verbose=self.__verbose

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in request

* *> * * return self._parse_response(h.getfile(), sock)

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in

* *> _parse_response

* *> * * return u.close()

* *> * File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close

* *> * * raise Fault(**self._stack[0])

* *> xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'object has no

* *> method: mac'">

* *>

* *> Line of code causing this problem:

* *>

* *> remote.modify_system(sys_id, 'mac', 'AA:BB:CCD:EE:FF', token)

* *>

* *> Any ideas? Using cobbler 0.8.3-3.el5

* *>

* *> Thanks,

* *>

* *> Eamonn

* *> _______________________________________________

* *> et-mgmt-tools mailing list

* *> et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>

* *> https://www.redhat.com/mailman/listinfo/et-mgmt-tools

* *--



* *Pablo Iranzo Gómez (Pablo.Iranzo@redhat.com

* *<mailto:Pablo.Iranzo@redhat.com>)

* *RHCE/Global Profesional Services Consultant Spain

* *Phone: +34 645 01 01 49 (CET/CEST)

* *GnuPG KeyID: 0xFAD3CF0D

* *---

* *Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3,

* *planta 3ºD, 28016 Madrid, Spain

* *Dirección Registrada: Red Hat S.L., C/ Velazquez 63, Madrid 28001,

* *Spain

* *Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941



* *_______________________________________________

* *et-mgmt-tools mailing list

* *et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>

* *https://www.redhat.com/mailman/listinfo/et-mgmt-tools





------------------------------------------------------------------------



_______________________________________________

et-mgmt-tools mailing list

et-mgmt-tools@redhat.com

https://www.redhat.com/mailman/listinfo/et-mgmt-tools




_______________________________________________

et-mgmt-tools mailing list

et-mgmt-tools@redhat.com

https://www.redhat.com/mailman/listinfo/et-mgmt-tools




_______________________________________________

et-mgmt-tools mailing list

et-mgmt-tools@redhat.com

https://www.redhat.com/mailman/listinfo/et-mgmt-tools







_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 04-30-2008, 01:47 PM
Michael DeHaan
 
Default Cobbler API - Mac registration problem

Eamonn Walsh wrote:
What I'm hoping to achieve here, is to register the system with
cobbler on first boot, I'm planning on plugging it into a script that
runs at first boot anyway. Since auto reg isn't part of cobbler
0.8.3-3.el5, I'm hoping to use this as a work around.


It works fine registering the system name and profile, but falls over
when I try and register the mac. Will have a snoop around in the code..


You have to do auto registration via the kickstart fetcher -- as
Anaconda doesn't send the MAC for all %pre/%post requests (like I
previously thought...). Another thing that had to be done was to make
some changes to allow those kind of URLs to be tolerated by the virt
code -- so all in all, your best bet is 0.9.X.





On Wed, Apr 30, 2008 at 12:41 PM, Michael DeHaan <mdehaan@redhat.com
<mailto:mdehaan@redhat.com>> wrote:


Michael DeHaan wrote:

Eamonn Walsh wrote:

Its just a test script at the moment, I want to see what
it can do

system_id = remote.new_system(token)
remote.modify_system(system_id,'name', 'Imatest2',token)
remote.modify_system(system_id,'profile', 'Testing',token)
remote.modify_system(system_id, 'mac',
'FF:EED:CC:BB:AA',token)
remote.save_system(system_id,token)

I think the problem is because the 'mac' key is in a
nested list, not sure though.


Ah, this is your script? Glad to see more interest in API hacking!
Yes, I did some work to add this recently. Definitely check
out the devel branch. If you are interested in the code, see
'remote.py' and 'services.py'.
The idea was to consolidate all of the cgi-bin stuff on
mod_python to simplify things. All of the mod_python code
('services.py') effectively sends requests
down to cobblerd via XMLRPC ('remote.py'). Since this relies
on kssendmac in the kernel options line, you won't see results
from running "wget", but if you request those kickstart URLs
from Anaconda registration (if enabled in settings via the new
option) will occur.

It has some security features in that it will not add a system
if mac is already in the "database" and works by detecting the
mac of the system
when they request the kickstart file from the mod python
kickstart generator (kickstarts are no longer statically
generated on the filesystem).

--Michael


In the interest of completeness, the issue is that cobbler now
suppports multiple network interfaces. So your script has to use
the API to modify network interfaces, which is slightly varied
from the above. See remote.py on the devel branch for how that is
done. The WebUI, which is written against the same XMLRPC
interface, is also a good reference. (cobbler/web/CobblerWeb.py)




On Wed, Apr 30, 2008 at 12:10 PM, Pablo Iranzo Gómez
<Pablo.Iranzo@redhat.com <mailto:Pablo.Iranzo@redhat.com>
<mailto:Pablo.Iranzo@redhat.com
<mailto:Pablo.Iranzo@redhat.com>>> wrote:


Is it possible to have the script to play with it?

Will try to check how this works and possible usages

Thanks!
Pablo

El mié, 30-04-2008 a las 09:42 +0100, Eamonn Walsh escribió:
> Hi Guys,
>
> Doing some work with the cobbler api and getting the
fallowing error
>
> Traceback (most recent call last):
> File "rpc-cobbler-test", line 20, in ?
> remote.modify_system(system_id, 'interfaces : mac_address',
> 'FF:EED:CC:BB:AA', token)
> File "/usr/lib/python2.4/xmlrpclib
> .py", line 1096, in __call__
> return self.__send(self.__name, args)
> File "/usr/lib/python2.4/xmlrpclib.py", line 1383, in
__request
> verbose=self.__verbose
> File "/usr/lib/python2.4/xmlrpclib.py", line 1147, in
request
> return self._parse_response(h.getfile(), sock)
> File "/usr/lib/python2.4/xmlrpclib.py", line 1286, in
> _parse_response
> return u.close()
> File "/usr/lib/python2.4/xmlrpclib.py", line 744, in close
> raise Fault(**self._stack[0])
> xmlrpclib.Fault: <Fault 1:
"cobbler.cexceptions.CX:'object has no
> method: mac'">
>
> Line of code causing this problem:
>
> remote.modify_system(sys_id, 'mac', 'AA:BB:CCD:EE:FF',
token)
>
> Any ideas? Using cobbler 0.8.3-3.el5
>
> Thanks,
>
> Eamonn
> _______________________________________________
> et-mgmt-tools mailing list
> et-mgmt-tools@redhat.com
<mailto:et-mgmt-tools@redhat.com>
<mailto:et-mgmt-tools@redhat.com
<mailto:et-mgmt-tools@redhat.com>>
> https://www.redhat.com/mailman/listinfo/et-mgmt-tools
--

Pablo Iranzo Gómez (Pablo.Iranzo@redhat.com
<mailto:Pablo.Iranzo@redhat.com>
<mailto:Pablo.Iranzo@redhat.com
<mailto:Pablo.Iranzo@redhat.com>>)
RHCE/Global Profesional Services Consultant Spain
Phone: +34 645 01 01 49 (CET/CEST)
GnuPG KeyID: 0xFAD3CF0D
---
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3,
planta 3ºD, 28016 Madrid, Spain
Dirección Registrada: Red Hat S.L., C/ Velazquez 63,
Madrid 28001,
Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>
<mailto:et-mgmt-tools@redhat.com
<mailto:et-mgmt-tools@redhat.com>>
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


------------------------------------------------------------------------

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com <mailto:et-mgmt-tools@redhat.com>
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


------------------------------------------------------------------------

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 05:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org