mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 05:12:30 +00:00 
			
		
		
		
	modify login error msg for openbmc python
This commit is contained in:
		@@ -51,12 +51,7 @@ class OpenBMCPowerTask(ParallelNodesCommand):
 | 
			
		||||
        bmc_not_ready = bmc_state = 'NotReady'
 | 
			
		||||
        try:
 | 
			
		||||
            obmc.login()
 | 
			
		||||
        except SelfServerException as e:
 | 
			
		||||
            # Special exception handling for login failure
 | 
			
		||||
            login_message = "Login to BMC failed: Can't connect to {0} {1}.".format(e.host_and_port, e.detail_msg)
 | 
			
		||||
            self.callback.error(login_message, node)
 | 
			
		||||
            return bmc_state
 | 
			
		||||
        except SelfClientException as e:
 | 
			
		||||
        except (SelfServerException, SelfClientException) as e:
 | 
			
		||||
            self.callback.error(e.message, node)
 | 
			
		||||
            return bmc_state
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -335,8 +335,11 @@ class OpenBMCRest(object):
 | 
			
		||||
            response = self.session.request(method, url, httpheaders, data=data, timeout=timeout)
 | 
			
		||||
            return self.handle_response(response, cmd=cmd)
 | 
			
		||||
        except SelfServerException as e:
 | 
			
		||||
            e.message = 'BMC did not respond. ' \
 | 
			
		||||
                        'Validate BMC configuration and retry the command.'
 | 
			
		||||
            if cmd == 'login':
 | 
			
		||||
                e.message = "Login to BMC failed: Can't connect to {0} {1}.".format(e.host_and_port, e.detail_msg)
 | 
			
		||||
            else:
 | 
			
		||||
                e.message = 'BMC did not respond. ' \
 | 
			
		||||
                            'Validate BMC configuration and retry the command.'
 | 
			
		||||
            self._print_error_log(e.message, cmd)
 | 
			
		||||
            raise
 | 
			
		||||
        except ValueError:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user