backend/satellite_tools/repo_plugins/yum_src.py | 2 +-
backend/satellite_tools/reposync.py | 15 ++++++++++-----
2 files changed, 11 insertions(+), 6 deletions(-)
New commits:
commit 2280dc149ddc31deca55e97c8bd1b7393e0ccf20
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Thu Jul 30 16:09:15 2009 -0400
fixing some import things to actually work on an installed system
diff --git a/backend/satellite_tools/repo_plugins/yum_src.py
b/backend/satellite_tools/repo_plugins/yum_src.py
index 77c6f57..a9c0ad6 100644
--- a/backend/satellite_tools/repo_plugins/yum_src.py
+++ b/backend/satellite_tools/repo_plugins/yum_src.py
@@ -16,7 +16,7 @@
import yum
import shutil
from yum import config
-from reposync import ContentPackage
+from satellite_tools.reposync import ContentPackage
class ContentSource:
url = None
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index e5074b0..053a8c4 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -39,6 +39,7 @@ class RepoSync:
rhnSQL.initDB(db_string)
(options, args) = self.process_args()
+
quit = False
if not options.url:
quit = True
@@ -53,6 +54,12 @@ class RepoSync:
quit = True
print("--label must be specified")
+ self.log_file = options.logfile
+ if self.log_file:
+ rhnLog.initLOG(self.log_file)
+
+ self.error_msg(str(sys.argv))
+
if quit:
sys.exit(1)
@@ -71,8 +78,6 @@ class RepoSync:
sys.exit(1)
- if self.log_file:
- rhnLog.initLOG(self.log_file)
self.plugin = self.load_plugin()(self.url, self.channel_label + "-" +
self.repo_label)
self.import_packages(self.plugin.list_packages())
@@ -88,10 +93,10 @@ class RepoSync:
return self.parser.parse_args()
def load_plugin(self):
- sys.path.append("repo_plugins")
name = self.type + "_src"
- mod = __import__(name)
- return getattr(mod, "ContentSource")
+ mod = __import__('satellite_tools.repo_plugins', globals(), locals(),
[name])
+ submod = getattr(mod, name)
+ return getattr(submod, "ContentSource")
def import_packages(self, packages):
to_link = []
Show replies by date