--- a/dell-satellite-sync.py 2011-09-30 10:38:21.042499336 -0500 +++ b/dell-satellite-sync.py 2011-09-30 11:37:20.205550928 -0500 @@ -52,6 +52,7 @@ 'rhel-x86_64-server-5' : { 'arch' : 'x86_64' , 'subdir' : 'rh50_64' }, 'rhel-i386-server-6' : { 'arch' : 'i386' , 'subdir' : 'rh60' }, 'rhel-x86_64-server-6' : { 'arch' : 'x86_64' , 'subdir' : 'rh60_64' }, + 'centos-x86_64-server-6' : { 'arch' : 'x86_64' , 'subdir' : 'rh60_64' }, } # Add channels that share arch and Dell repo subdir to the respective list @@ -61,6 +62,7 @@ RHEL5_x86_64_ALTS = ['rhel-x86_64-server-5.0.z','rhel-x86_64-server-5.1.z','rhel-x86_64-server-5.2.z','rhel-x86_64-server-5.3.ll','rhel-x86_64-server-5.3.z','rhel-x86_64-server-5.4.z','rhel-x86_64-server-5.6.z'] RHEL6_i386_ALTS = [] RHEL6_x86_64_ALTS = [] +CENTOS6_x86_64_ALTS = [] ################################################################################### @@ -90,6 +92,7 @@ parser.add_option("-S", "--server-actions-only", action="store_true", dest="server_actions_only", help="Only create channels and upload rpms, skip client subscription", default=False) parser.add_option("-C", "--client-actions-only", action="store_true", dest="client_actions_only", help="Only subscribe clients (channels and rpms must already be on server)", default=False) parser.add_option("-c", "--client-mode", action="store_true", dest="client_mode", help="Runs client actions only from a client (feature not implemented yet))", default=False) +parser.add_option("-6", "--centos6-only", action="store_true", dest="centos6_only", help="Only work with CentOS 6 base channels", default=False) parser.add_option("-6", "--rhel6-only", action="store_true", dest="rhel6_only", help="Only work with RHEL 6 base channels", default=False) parser.add_option("-5", "--rhel5-only", action="store_true", dest="rhel5_only", help="Only work with RHEL 5 base channels", default=False) parser.add_option("-4", "--rhel4-only", action="store_true", dest="rhel4_only", help="Only work with RHEL 4 base channels", default=False) @@ -107,8 +110,8 @@ options.repo = options.repo.split('http://')[-1] # Strip any http:// prefixes GPG_URL='http://%s' % options.repo error = False -if not (options.delete or (options.rhel5_only or options.rhel4_only or options.rhel6_only)): - print timestamp(), "! Error: 'Must specify either '--rhel6-only' or '--rhel5-only' or '--rhel4-only' for version 0.4 or earlier." +if not (options.delete or (options.rhel5_only or options.rhel4_only or options.rhel6_only or options.centos6_only)): + print timestamp(), "! Error: 'Must specify either '--centos6-only' '--rhel6-only' or '--rhel5-only' or '--rhel4-only' for version 0.4 or earlier." error = True if options.server_actions_only and options.client_actions_only: print timestamp(), "! Error: '--server-actions-only' and '--client-actions-only' are mutually exclusive" @@ -153,7 +156,10 @@ # Clone details on base channels - moved here to make choices based on options # RHEL 6 i386 channels -if not options.rhel6_only and not options.rhel5_only and not options.rhel4_only: +if not options.centos6_only and not options.rhel6_only and not options.rhel5_only and not options.rhel4_only: + # CentOS 6 x86_64 channels + for version in CENTOS6_x86_64_ALTS: + SUPPORTED_CHANNELS[version] = SUPPORTED_CHANNELS['centos-x86_64-server-6'] # RHEL 6 i386 channels for version in RHEL6_i386_ALTS: SUPPORTED_CHANNELS[version] = SUPPORTED_CHANNELS['rhel-i386-server-6'] @@ -173,12 +179,22 @@ for version in RHEL4_x86_64_ALTS: SUPPORTED_CHANNELS[version] = SUPPORTED_CHANNELS['rhel-x86_64-as-4'] +if options.centos6_only: + # Remove base channels that are not RHEL 6 here + del SUPPORTED_CHANNELS['rhel-i386-server-6'] + del SUPPORTED_CHANNELS['rhel-x86_64-server-6'] + del SUPPORTED_CHANNELS['rhel-i386-server-5'] + del SUPPORTED_CHANNELS['rhel-x86_64-server-5'] + del SUPPORTED_CHANNELS['rhel-i386-as-4'] + del SUPPORTED_CHANNELS['rhel-x86_64-as-4'] + if options.rhel6_only: # Remove base channels that are not RHEL 6 here del SUPPORTED_CHANNELS['rhel-i386-server-5'] del SUPPORTED_CHANNELS['rhel-x86_64-server-5'] del SUPPORTED_CHANNELS['rhel-i386-as-4'] del SUPPORTED_CHANNELS['rhel-x86_64-as-4'] + del SUPPORTED_CHANNELS['centos-x86_64-server-6'] # RHEL 5 i386 channels if options.rhel5_only: @@ -187,6 +203,7 @@ del SUPPORTED_CHANNELS['rhel-x86_64-as-4'] del SUPPORTED_CHANNELS['rhel-i386-server-6'] del SUPPORTED_CHANNELS['rhel-x86_64-server-6'] + del SUPPORTED_CHANNELS['centos-x86_64-server-6'] # RHEL 4 i386 channels @@ -196,6 +213,7 @@ del SUPPORTED_CHANNELS['rhel-x86_64-server-5'] del SUPPORTED_CHANNELS['rhel-i386-server-6'] del SUPPORTED_CHANNELS['rhel-x86_64-server-6'] + del SUPPORTED_CHANNELS['centos-x86_64-server-6'] sat_url = "http://%s/rpc/api" % options.satserver if options.debug: