def update_sorcery(module):
 changed = False
 if module.check_mode:
  if ((not module.params['name']) and (not module.params['update_cache'])):
   module.exit_json(changed=True, msg='would have updated Sorcery')
 else:
  sorcery_ver = get_sorcery_ver(module)
  cmd_sorcery = ('%s update' % SORCERY['sorcery'])
  (rc, stdout, stderr) = module.run_command(cmd_sorcery)
  if (rc != 0):
   module.fail_json(msg=('unable to update Sorcery: ' + stdout))
  if (sorcery_ver != get_sorcery_ver(module)):
   changed = True
  if ((not module.params['name']) and (not module.params['update_cache'])):
   module.exit_json(changed=changed, msg='successfully updated Sorcery')

def update_sorcery ( module ) : changed = False if module . check_mode : if ( ( not module . params [ 'name' ] ) and ( not module . params [ 'update_cache' ] ) ) : module . exit_json ( changed = True , msg = 'would have updated Sorcery' ) else : sorcery_ver = get_sorcery_ver ( module ) cmd_sorcery = ( '%s update' % SORCERY [ 'sorcery' ] ) ( rc , stdout , stderr ) = module . run_command ( cmd_sorcery ) if ( rc != 0 ) : module . fail_json ( msg = ( 'unable to update Sorcery: ' + stdout ) ) if ( sorcery_ver != get_sorcery_ver ( module ) ) : changed = True if ( ( not module . params [ 'name' ] ) and ( not module . params [ 'update_cache' ] ) ) : module . exit_json ( changed = changed , msg = 'successfully updated Sorcery' )
update sorcery scripts .