Hi,

Am Donnerstag, 5. Januar 2012, 16:46:04 schrieb Miroslav Suchý:
> On 01/02/2012 04:30 PM, Michael Calmer wrote:
> > Hi,
> >
> > happy new year.
> >
> > I have attached two small patches to imporove the SUSE client support.
> >
> > The first one is a general workaround for a not installed yum.
> > Currently the classes are only defined if platform is "deb", but also on
> > SUSE
> > with zypp plugin, yum is not installed.
> > Additionally it fixes some python errors in the original code. You cannot
> > assign a class which is defined later.
> >
> > The second one is a small patch to check for the zypp plugin and hide the
> > warning about the not installed yum plugin.
> 
> Second patch commited.
> 
> I had mental problem with first patch. I do not like replacing 'if' by 
> 'try/except'.
> This cover *why* we are doing that. Putting comment after that except 
> saying that "debian and suse do not have this class..." would be most 
> easier fix.
> But I would most rather see there
>    if getPlatform() == 'deb' or isThisSuse():

Ok, but looking into it more deeply I wonder how this can work. I cannot find 
a function called "getPlatform()" in the module "platform" (python 2.6/2.7) 

# python -c "from platform import getPlatform"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name getPlatform

There is a function "platform()" but this returns something like this:

 Linux-2.6.32.49-0.3-default-x86_64-with-SuSE-11-x86_64

I think it does not return only "deb" on debian.
 
Do you know where this getPlatform come from?

> BTW, how behaves zypper? If spacewalk code raise error, what is zypper 
> behavior? Yum will print nice error message, if that raised error is 
> instance of YumBaseError. If not, then yum will print full traceback.
> Does have zypper similar behaviour?

Not sure. The zypp plugin was developed by our zypp maintainers. Maybe Duncan 
can answer this question.

-- 
Regards

        Michael Calmer

--------------------------------------------------------------------------
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--------------------------------------------------------------------------
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to