@@ -142,39 +142,43 @@ def check_valid_auth_options(options, auth_plugin_name, required_scope=True):
142142
143143 """
144144
145- msg = ''
145+ msgs = []
146146 if auth_plugin_name .endswith ('password' ):
147147 if not options .auth .get ('username' ):
148- msg += _ ('Set a username with --os-username, OS_USERNAME,'
149- ' or auth.username\n ' )
148+ msgs . append ( _ ('Set a username with --os-username, OS_USERNAME,'
149+ ' or auth.username' ) )
150150 if not options .auth .get ('auth_url' ):
151- msg += _ ('Set an authentication URL, with --os-auth-url,'
152- ' OS_AUTH_URL or auth.auth_url\n ' )
151+ msgs . append ( _ ('Set an authentication URL, with --os-auth-url,'
152+ ' OS_AUTH_URL or auth.auth_url' ) )
153153 if (required_scope and not
154154 options .auth .get ('project_id' ) and not
155155 options .auth .get ('domain_id' ) and not
156156 options .auth .get ('domain_name' ) and not
157157 options .auth .get ('project_name' ) and not
158158 options .auth .get ('tenant_id' ) and not
159159 options .auth .get ('tenant_name' )):
160- msg += _ ('Set a scope, such as a project or domain, set a '
161- 'project scope with --os-project-name, OS_PROJECT_NAME '
162- 'or auth.project_name, set a domain scope with '
163- '--os-domain-name, OS_DOMAIN_NAME or auth.domain_name' )
160+ msgs .append (_ ('Set a scope, such as a project or domain, set a '
161+ 'project scope with --os-project-name, '
162+ 'OS_PROJECT_NAME or auth.project_name, set a domain '
163+ 'scope with --os-domain-name, OS_DOMAIN_NAME or '
164+ 'auth.domain_name' ))
164165 elif auth_plugin_name .endswith ('token' ):
165166 if not options .auth .get ('token' ):
166- msg += _ ('Set a token with --os-token, OS_TOKEN or auth.token\n ' )
167+ msgs .append (_ ('Set a token with --os-token, OS_TOKEN or '
168+ 'auth.token' ))
167169 if not options .auth .get ('auth_url' ):
168- msg += _ ('Set a service AUTH_URL, with --os-auth-url, '
169- 'OS_AUTH_URL or auth.auth_url\n ' )
170+ msgs . append ( _ ('Set a service AUTH_URL, with --os-auth-url, '
171+ 'OS_AUTH_URL or auth.auth_url' ) )
170172 elif auth_plugin_name == 'token_endpoint' :
171173 if not options .auth .get ('token' ):
172- msg += _ ('Set a token with --os-token, OS_TOKEN or auth.token\n ' )
174+ msgs .append (_ ('Set a token with --os-token, OS_TOKEN or '
175+ 'auth.token' ))
173176 if not options .auth .get ('url' ):
174- msg += _ ('Set a service URL, with --os-url, OS_URL or auth.url\n ' )
177+ msgs .append (_ ('Set a service URL, with --os-url, OS_URL or '
178+ 'auth.url' ))
175179
176- if msg :
177- raise exc .CommandError ('Missing parameter(s): \n %s' % msg )
180+ if msgs :
181+ raise exc .CommandError ('Missing parameter(s): \n %s' % ' \n ' . join ( msgs ) )
178182
179183
180184def build_auth_plugins_option_parser (parser ):
0 commit comments