[Spacewalk-list] Python API: create software Channel with gpgkey information
Waldemar Gorus
gorusw at wwu.de
Tue Dec 7 10:07:29 UTC 2010
Hello,
I am just testing spacewalk a lot. For that I wrote a python script for
creating, cloning, synchronizing and deleting channels automatically. I
would like to set the gpgkey-information during the progress of channel
creation, but I have problems with the method declaration:
The following python piece works well without the additional gpgKey
information, but fails with. Somehow I fail with the python struct
'construct'. Thank you for any hints
for section in channelList:
client.channel.software.create (sKey,
section,
config.get(section, "name"),
config.get(section, "summary"),
config.get(section, "archLabel"),
config.get(section, "parentLabel"),
config.get(section, "checksumType"),
pack('sss', config.get(section, "gpgKey.url"),
config.get(section, "gpgKey.id"),
config.get(section, "gpgKey.print")))
Here is the method from spacewalk doc API used:
Method: create
<https://i5spacewalk/rhn/apidoc/handlers/ChannelSoftwareHandler.jsp#top>
Description:
Creates a software channel
Parameters:
* string sessionKey
* string label - label of the new channel
* string name - name of the new channel
* string summary - summary of the channel
* string archLabel - the label of the architecture the channel
corresponds to
o channel-ia32 - For 32 bit channel architecture
o [..]
* string parentLabel - label of the parent of this channel, an empty
string if it does not have one
* string checksumType - checksum type for this channel, used for yum
repository metadata generation
o sha1 - Offers widest compatibility with clients
o sha256 - Offers highest security, but is compatible only
with newer clients: Fedora 11 and newer, or Enterprise Linux
6 and newer.
* struct - gpgKey
o string "url" - GPG key URL
o string "id" - GPG key ID
o string "fingerprint" - GPG key Fingerprint
Thank you
Waldemar
--
Waldemar Gorus | Tel. : +49 (0)251 83-32747
Universität Münster | Fax : +49 (0)251 83-32742
Institut für Informatik | email: gorusw at wwu.de
Einsteinstr. 62 |
D-48149 Münster, Germany |
More information about the Spacewalk-list
mailing list