Package ganeti :: Package rapi :: Package auth :: Module users_file
[hide private]
[frames] | no frames]

Module users_file

source code

RAPI users config file parser.

Classes [hide private]
  PasswordFileUser
Data structure for users from password file.
  RapiUsers
Functions [hide private]
dict
ParsePasswordFile(contents)
Parses the contents of a password file.
source code

Imports: errno, logging, utils


Function Details [hide private]

ParsePasswordFile(contents)

source code 

Parses the contents of a password file.

Lines in the password file are of the following format:

   <username> <password> [options]

Fields are separated by whitespace. Username and password are mandatory, options are optional and separated by comma (','). Empty lines and comments ('#') are ignored.

Parameters:
  • contents (str) - Contents of password file
Returns: dict
Dictionary containing PasswordFileUser instances