mirror of
				https://github.com/xcat2/confluent.git
				synced 2025-10-31 03:12:31 +00:00 
			
		
		
		
	Fix add_local_repositories in v6 environment
This commit is contained in:
		| @@ -7,15 +7,26 @@ import imp | ||||
| import sys | ||||
| apiclient = imp.load_source('apiclient', '/opt/confluent/bin/apiclient') | ||||
| repo = None | ||||
| server4 = None | ||||
| server = None | ||||
| server6 = None | ||||
| profile = None | ||||
| v4cfg = None | ||||
| with open('/etc/confluent/confluent.deploycfg') as dplcfgfile: | ||||
|     lines = dplcfgfile.read().split('\n') | ||||
|     for line in lines: | ||||
|         if line.startswith('deploy_server:'): | ||||
|            _, server = line.split(' ', 1) | ||||
|            _, server4 = line.split(' ', 1) | ||||
|         if line.startswith('deploy_server_v6:'): | ||||
|            _, server6 = line.split(' ', 1) | ||||
|         if line.startswith('profile: '): | ||||
|            _, profile = line.split(' ', 1) | ||||
| 	if line.startswith('ipv4_method: '): | ||||
|            _, v4cfg = line.split(' ', 1) | ||||
| if v4cfg == 'static' or v4cfg =='dhcp': | ||||
|     server = server4 | ||||
| if not server: | ||||
|     server = '[{}]'.format(server6) | ||||
|  | ||||
| path = '/confluent-public/os/{0}/distribution/'.format(profile) | ||||
| clnt = apiclient.HTTPSClient() | ||||
|   | ||||
| @@ -12,14 +12,25 @@ apiclient = importlib.util.module_from_spec(modspec) | ||||
| modspec.loader.exec_module(apiclient) | ||||
| repo = None | ||||
| server = None | ||||
| v4cfg = None | ||||
| server4 = None | ||||
| server6 = None | ||||
| profile = None | ||||
| with open('/etc/confluent/confluent.deploycfg') as dplcfgfile: | ||||
|     lines = dplcfgfile.read().split('\n') | ||||
|     for line in lines: | ||||
|         if line.startswith('deploy_server:'): | ||||
|            _, server = line.split(' ', 1) | ||||
|            _, server4 = line.split(' ', 1) | ||||
|         if line.startswith('deploy_server_v6:'): | ||||
|            _, server6 = line.split(' ', 1) | ||||
|         if line.startswith('profile: '): | ||||
|            _, profile = line.split(' ', 1) | ||||
| 	if line.startswith('ipv4_method: '): | ||||
|            _, v4cfg = line.split(' ', 1) | ||||
| if v4cfg == 'static' or v4cfg =='dhcp': | ||||
|     server = server4 | ||||
| if not server: | ||||
|     server = '[{}]'.format(server6) | ||||
|  | ||||
| path = '/confluent-public/os/{0}/distribution/'.format(profile) | ||||
| clnt = apiclient.HTTPSClient() | ||||
|   | ||||
| @@ -12,14 +12,25 @@ apiclient = importlib.util.module_from_spec(modspec) | ||||
| modspec.loader.exec_module(apiclient) | ||||
| repo = None | ||||
| server = None | ||||
| v4cfg = None | ||||
| server4 = None | ||||
| server6 = None | ||||
| profile = None | ||||
| with open('/etc/confluent/confluent.deploycfg') as dplcfgfile: | ||||
|     lines = dplcfgfile.read().split('\n') | ||||
|     for line in lines: | ||||
|         if line.startswith('deploy_server:'): | ||||
|            _, server = line.split(' ', 1) | ||||
|            _, server4 = line.split(' ', 1) | ||||
|         if line.startswith('deploy_server_v6:'): | ||||
|            _, server6 = line.split(' ', 1) | ||||
|         if line.startswith('profile: '): | ||||
|            _, profile = line.split(' ', 1) | ||||
| 	if line.startswith('ipv4_method: '): | ||||
|            _, v4cfg = line.split(' ', 1) | ||||
| if v4cfg == 'static' or v4cfg =='dhcp': | ||||
|     server = server4 | ||||
| if not server: | ||||
|     server = '[{}]'.format(server6) | ||||
|  | ||||
| path = '/confluent-public/os/{0}/distribution/'.format(profile) | ||||
| clnt = apiclient.HTTPSClient() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user