backend/satellite_tools/satsync.py | 9 +++++----
backend/satellite_tools/sync_handlers.py | 13 ++++++++-----
2 files changed, 13 insertions(+), 9 deletions(-)
New commits:
commit b3cd83ba4a828c56ef7c004e49cc6ed62a7d4867
Author: Pradeep Kilambi <pkilambi(a)redhat.com>
Date: Wed Jul 1 19:28:49 2009 -0400
fixing the org id logic to take into account nul orgs
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 9be12e9..3c44efb 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -2007,10 +2007,11 @@ def _validate_package_org(batch):
orgid = OPTIONS.orgid or None
orgs = map(lambda a: a['id'], satCerts.get_all_orgs())
for pkg in batch:
- if pkg['org_id'] is not None and pkg['org_id'] not in orgs:
- orgid = 1
- if orgid is not None and pkg['org_id'] is not None and \
- pkg['org_id'] != orgid:
+ if not OPTIONS.orgid and pkg['org_id'] is not None and \
+ pkg['org_id'] not in orgs:
+
+ pkg['org_id'] = 1
+ else:
pkg['org_id'] = orgid
diff --git a/backend/satellite_tools/sync_handlers.py
b/backend/satellite_tools/sync_handlers.py
index f2488a7..6ffbbe5 100644
--- a/backend/satellite_tools/sync_handlers.py
+++ b/backend/satellite_tools/sync_handlers.py
@@ -197,14 +197,17 @@ def import_channels(channels, orgid=None):
# 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())
- if c_obj['org_id'] is not None and c_obj['org_id'] not in orgs:
+ 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 = str(1)
- if orgid is not None and c_obj['org_id'] is not None and \
- c_obj['org_id'] != orgid:
+ #orgid = 1
+ c_obj['org_id'] = 1
+ else:
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-' +
c_obj['org_id']
+ family['label'] = 'private-channel-family-' +
str(c_obj['org_id'])
batch.append(c_obj)
Show replies by date