def get_boot_options(module):
 command = 'show boot'
 body = execute_show_command(command, module)[0]
 boot_options_raw_text = body.split('Boot Variables on next reload')[1]
 if ('kickstart' in boot_options_raw_text):
  kick_regex = 'kickstart variable = bootflash:/(\\S+)'
  sys_regex = 'system variable = bootflash:/(\\S+)'
  kick = re.search(kick_regex, boot_options_raw_text).group(1)
  sys = re.search(sys_regex, boot_options_raw_text).group(1)
  retdict = dict(kick=kick, sys=sys)
 else:
  nxos_regex = 'NXOS variable = bootflash:/(\\S+)'
  nxos = re.search(nxos_regex, boot_options_raw_text).group(1)
  retdict = dict(sys=nxos)
 command = 'show install all status'
 retdict['status'] = execute_show_command(command, module)[0]
 return retdict

def get_boot_options ( module ) : command = 'show boot' body = execute_show_command ( command , module ) [ 0 ] boot_options_raw_text = body . split ( 'Boot Variables on next reload' ) [ 1 ] if ( 'kickstart' in boot_options_raw_text ) : kick_regex = 'kickstart variable = bootflash:/(\\S+)' sys_regex = 'system variable = bootflash:/(\\S+)' kick = re . search ( kick_regex , boot_options_raw_text ) . group ( 1 ) sys = re . search ( sys_regex , boot_options_raw_text ) . group ( 1 ) retdict = dict ( kick = kick , sys = sys ) else : nxos_regex = 'NXOS variable = bootflash:/(\\S+)' nxos = re . search ( nxos_regex , boot_options_raw_text ) . group ( 1 ) retdict = dict ( sys = nxos ) command = 'show install all status' retdict [ 'status' ] = execute_show_command ( command , module ) [ 0 ] return retdict
get current boot variables like system image and kickstart image .