Improve output of supported API versions
Sort supported versions properly for better look. Change-Id: I6c2f5ecc04cf14ea5bf1b214cb303fcc9783af3f Closes-Bug: #1630962
This commit is contained in:
		@@ -93,10 +93,12 @@ class OpenStackShell(shell.OpenStackShell):
 | 
				
			|||||||
                mod_versions = getattr(mod, 'API_VERSIONS', None)
 | 
					                mod_versions = getattr(mod, 'API_VERSIONS', None)
 | 
				
			||||||
                if not skip_old_check and mod_versions:
 | 
					                if not skip_old_check and mod_versions:
 | 
				
			||||||
                    if version_opt not in mod_versions:
 | 
					                    if version_opt not in mod_versions:
 | 
				
			||||||
 | 
					                        sorted_versions = sorted(
 | 
				
			||||||
 | 
					                            mod.API_VERSIONS.keys(),
 | 
				
			||||||
 | 
					                            key=lambda s: list(map(int, s.split('.'))))
 | 
				
			||||||
                        self.log.warning(
 | 
					                        self.log.warning(
 | 
				
			||||||
                            "%s version %s is not in supported versions %s"
 | 
					                            "%s version %s is not in supported versions: %s"
 | 
				
			||||||
                            % (api, version_opt,
 | 
					                            % (api, version_opt, ', '.join(sorted_versions)))
 | 
				
			||||||
                               ', '.join(list(mod.API_VERSIONS.keys()))))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                # Command groups deal only with major versions
 | 
					                # Command groups deal only with major versions
 | 
				
			||||||
                version = '.v' + version_opt.replace('.', '_').split('_')[0]
 | 
					                version = '.v' + version_opt.replace('.', '_').split('_')[0]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user