def oo_generate_secret(num_bytes):
 if (not isinstance(num_bytes, int)):
  raise errors.AnsibleFilterError('|failed expects num_bytes is int')
 secret = os.urandom(num_bytes)
 return secret.encode('base-64').strip()

def oo_generate_secret ( num_bytes ) : if ( not isinstance ( num_bytes , int ) ) : raise errors . AnsibleFilterError ( '|failed expects num_bytes is int' ) secret = os . urandom ( num_bytes ) return secret . encode ( 'base-64' ) . strip ( )
generate a session secret .