Show More
@@ -81,9 +81,14 b' def get_vcs_server_protocol(config):' | |||
|
81 | 81 | |
|
82 | 82 | |
|
83 | 83 | def set_instance_id(config): |
|
84 | """ Sets a dynamic generated config['instance_id'] if missing or '*' """ | |
|
84 | """ | |
|
85 | Sets a dynamic generated config['instance_id'] if missing or '*' | |
|
86 | E.g instance_id = *cluster-1 or instance_id = * | |
|
87 | """ | |
|
85 | 88 | |
|
86 | 89 | config['instance_id'] = config.get('instance_id') or '' |
|
87 | if config['instance_id'] == '*' or not config['instance_id']: | |
|
90 | instance_id = config['instance_id'] | |
|
91 | if instance_id.startswith('*') or not instance_id: | |
|
92 | prefix = instance_id.lstrip('*') | |
|
88 | 93 | _platform_id = platform.uname()[1] or 'instance' |
|
89 | config['instance_id'] = '%s-%s' % (_platform_id, os.getpid()) | |
|
94 | config['instance_id'] = '%s%s-%s' % (prefix, _platform_id, os.getpid()) |
General Comments 0
You need to be logged in to leave comments.
Login now