Hi,

Am Montag, 16. Januar 2012, 13:01:13 schrieb Jan Pazdziora:
> On Mon, Jan 16, 2012 at 12:15:26PM +0100, Michael Calmer wrote:
> > > 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?
> 
> It's in
> 
>       client/rhel/rhn-client-tools/src/up2date_client/platform.py

Ahh, thanks. But this is bad. I would like to use the official platform module 
from python in the same file, but this result in namespace conflicts.
The first path in sys.path is "." which means, that the result of

  from platform import dist

is a Traceback with ImportError: cannot import name dist

What do you think about renaming the up2date_client/platform.py to something 
like up2date_client/pkgplatform.py ?

Does anybody have other ideas how to solve this?

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