Package ganeti :: Package tools :: Module ensure_dirs
[hide private]
[frames] | no frames]

Module ensure_dirs

source code

Script to ensure permissions on files/dirs are accurate.

Functions [hide private]
 
RecursiveEnsure(path, uid, gid, dir_perm, file_perm)
Ensures permissions recursively down a directory.
source code
 
EnsureQueueDir(path, mode, uid, gid)
Sets the correct permissions on all job files in the queue.
source code
 
ProcessPath(path)
Processes a path component.
source code
 
GetPaths()
Returns a tuple of path objects to process.
source code
 
ParseOptions()
Parses the options passed to the program.
source code
 
Main()
Main routine.
source code
Variables [hide private]
  ALL_TYPES = compat.UniqueFrozenset([DIR, FILE, QUEUE_DIR,])

Imports: os, optparse, sys, logging, constants, errors, runtime, ssconf, utils, cli, pathutils, compat


Function Details [hide private]

RecursiveEnsure(path, uid, gid, dir_perm, file_perm)

source code 

Ensures permissions recursively down a directory.

This functions walks the path and sets permissions accordingly.

Parameters:
  • path - The absolute path to walk
  • uid - The uid used as owner
  • gid - The gid used as group
  • dir_perm - The permission bits set for directories
  • file_perm - The permission bits set for files

EnsureQueueDir(path, mode, uid, gid)

source code 

Sets the correct permissions on all job files in the queue.

Parameters:
  • path - Directory path
  • mode - Wanted file mode
  • uid - Wanted user ID
  • gid - Wanted group ID

ProcessPath(path)

source code 

Processes a path component.

Parameters:
  • path - A tuple of the path component to process

ParseOptions()

source code 

Parses the options passed to the program.

Returns:
Options and arguments