From 115f31ec1abda183fd932ab6bb5d9a231593235f Mon Sep 17 00:00:00 2001 From: lrossett Date: Sep 10 2020 15:29:31 +0000 Subject: fix lookasidecache fn --- diff --git a/src/centpkg/cli/__init__.py b/src/centpkg/cli/__init__.py index 80b4720..c324e25 100644 --- a/src/centpkg/cli/__init__.py +++ b/src/centpkg/cli/__init__.py @@ -6,10 +6,8 @@ import configparser import pyrpkg.utils import pyrpkg -# import pyrpkg.cli -import centpkg.api.cli -from ..api import lookaside +import centpkg.api as centapi class Commands(pyrpkg.Commands): @@ -17,15 +15,14 @@ class Commands(pyrpkg.Commands): """Init the object and some configuration details.""" super(Commands, self).__init__(*args, **kwargs) + @pyrpkg.utils.cached_property def lookasidecache(self): """A helper to interact with the lookaside cache We override this because we need a different download path. """ - @pyrpkg.utils.cached_property - def lookasidecache(self): - return lookaside.CentOSLookasideCache( - self.lookasidehash, self.lookaside, self.lookaside_cgi) + return centapi.lookaside.CentOSLookasideCache( + self.lookasidehash, self.lookaside, self.lookaside_cgi) def get_log(client): @@ -65,7 +62,7 @@ def run(*args, **kwargs): config = configparser.SafeConfigParser() config.read(args.config) - client = centpkg.api.cli.CentPkgCli(config) + client = centapi.cli.CentPkgCli(config) client.do_imports(cli_name) client.parse_cmdline() @@ -73,7 +70,7 @@ def run(*args, **kwargs): try: client.args.path = pyrpkg.utils.getcwd() except Exception: - print('Could not get current path, have you deleted it?') + sys.stderr.write('Could not get current path, have you deleted it?\n') sys.exit(1) log = pyrpkg.log