ginger icon indicating copy to clipboard operation
ginger copied to clipboard

Ginger has failed to load on s390x due to new dependency introduced by servers.py

Open jay-katta opened this issue 8 years ago • 9 comments

@danielhb , Ginger has failed to load on s390x due to new dependency python module introduced by servers.py.

from Crypto.Cipher import AES

jay-katta avatar Aug 24 '16 10:08 jay-katta

Problem we are introducing here is package dependency which might not be available on supported distros.

Questions are:

  1. How can we make sure we will not brake distros with package dependencies ?
  2. How can we avoid situations where package available on certain distros but will not brake other distros if not available ?

some thing like we did in ginger repository management: def init(self): try: import('dnf') self._pkg_mnger = YumRepo() except ImportError: try: import('yum') self._pkg_mnger = YumRepo() except ImportError: try: import('apt_pkg') self._pkg_mnger = AptRepo() except ImportError: raise InvalidOperation('GGBREPOS0014E')

potula-chandra avatar Aug 24 '16 11:08 potula-chandra

@jay-katta on my system (Fedora 24 x86_64) this modules is provided by the package python2-crypto-2.6.1-10.fc24.x86_64.

Are s390x distros providing something like? You need to have PyCrypto (https://pypi.python.org/pypi/pycrypto) installed in your system.

pvital avatar Aug 24 '16 11:08 pvital

Unfortunately this package readily available on s390x (KVM distribution)

potula-chandra avatar Aug 24 '16 11:08 potula-chandra

Debian has: https://packages.debian.org/jessie/python-crypto

pvital avatar Aug 24 '16 11:08 pvital

On 08/24/2016 08:29 AM, Chandra Shekhar Reddy wrote:

Problem we are introducing here is package dependency which might not be available on supported distros.

Questions are:

  1. How can we make sure we will not brake distros with package dependencies ?
  2. How can we avoid situations where package available on certain distros but will not brake other distros if not available ?

I don't have access to a s390x to testing so I can't tell if a package is available there or not. The one thing we can do to avoid this is to have Z folks testing the new backend contributions to spot this problems while the patch is on review.

some thing like we did in ginger repository management: def init(self): try: import('dnf') self./pkg_mnger = YumRepo() except ImportError: try: _import/('yum') self./pkg_mnger = YumRepo() except ImportError: try: _import/('apt_pkg') self._pkg_mnger = AptRepo() except ImportError: raise InvalidOperation('GGBREPOS0014E')

Yeah, usage of relative imports can workaround this problem.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kimchi-project/ginger/issues/386#issuecomment-242032247, or mute the thread https://github.com/notifications/unsubscribe-auth/AA053IYVH5pwAYGEEEJs0CZ5jvqfgUkmks5qjCsJgaJpZM4Jr320.

danielhb avatar Aug 24 '16 12:08 danielhb

To solve the problem for s390x, since the package is not readily available, will try out the relative imports.. But would need some help in testing in the s390x environment.

hari-g-m avatar Aug 24 '16 13:08 hari-g-m

Hi, I made a change to servers.py to do a dynamic import. Would some one from the s390x team be able to try out the change & see if the issue is getting resolved? Thanks.

hari-g-m avatar Aug 24 '16 18:08 hari-g-m

@pvital I see two python packages for crytpo library.

https://www.rpmfind.net/linux/rpm2html/search.php?query=python-crypto http://www.rpmfind.net/linux/rpm2html/search.php?query=python2-crypto

Any reason why we are keeping python2-crypto has dependency for x86 fedora/redhat environments ?

potula-chandra avatar Aug 29 '16 06:08 potula-chandra

@chandrureddy I used as base to add the dependency a Fedora 24 system, that will be the next Fedora supported version of ginger (and all other packages). python-crypto is not available on Fedora 24.

You can check that README file is listen different package names for each system.

pvital avatar Aug 29 '16 12:08 pvital