backend/satellite_tools/sync_handlers.py | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
New commits:
commit 301b179fbfefca0f888ee5da153e2e7c53c344d8
Author: Pradeep Kilambi <pkilambi(a)redhat.com>
Date: Wed Jul 1 20:27:30 2009 -0400
some clean up and todos to work on
diff --git a/backend/satellite_tools/sync_handlers.py
b/backend/satellite_tools/sync_handlers.py
index 6ffbbe5..567f8ee 100644
--- a/backend/satellite_tools/sync_handlers.py
+++ b/backend/satellite_tools/sync_handlers.py
@@ -183,6 +183,7 @@ def import_channels(channels, orgid=None):
collection = ChannelCollection()
batch = []
import satCerts
+ orgs = map(lambda a: a['id'], satCerts.get_all_orgs())
for c in channels:
try:
timestamp = collection.get_channel_timestamp(c)
@@ -195,19 +196,20 @@ def import_channels(channels, orgid=None):
# Check to see if we're asked to sync to an orgid,
# make sure the org from the export is not null org,
# finally if the orgs differ so we might wanna use
- # requested org's channel-family.
- orgs = map(lambda a: a['id'], satCerts.get_all_orgs())
+ # requested org's channel-family.
+ # TODO: Move these checks somewhere more appropriate
if not orgid and c_obj['org_id'] is not None and \
c_obj['org_id'] not in orgs:
#If the src org is not present default to org 1
- #orgid = 1
- c_obj['org_id'] = 1
- else:
+ orgid = 1
+
+ if orgid is not None and c_obj['org_id'] is not None and \
+ c_obj['org_id'] != orgid:
+ #Only set the channel family if its a custom channel
c_obj['org_id'] = orgid
- #Only set the channel family if its a custom channel
- if c_obj['org_id'] is not None and c_obj['org_id'] != orgid:
for family in c_obj['families']:
- family['label'] = 'private-channel-family-' +
str(c_obj['org_id'])
+ family['label'] = 'private-channel-family-' + \
+ str(c_obj['org_id'])
batch.append(c_obj)
Show replies by date