Module Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias Import alias Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str TryExcept body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Raise Call NameLoad BinOpAdd Str AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body TryExcept body If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Pass decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str decorator_list If CompareEq NameLoad Str body Assign NameStore Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Num keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Print AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str With NameLoad body Expr Call AttributeLoad NameLoad attr Str TryExcept body Expr Call NameLoad NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad keyword NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num
N/A N/A argparse N/A fcntl N/A logging N/A logging.config N/A os N/A sys setproctitle setproctitle N/A daemon N/A HERE N/A N/A N/A os path abspath N/A N/A N/A os path dirname __file__ N/A N/A N/A N/A sys path append N/A N/A N/A os path join HERE .. N/A N/A N/A N/A sys path append N/A N/A N/A os path join HERE ../.. N/A N/A N/A N/A sys path append /usr/local/www N/A N/A N/A N/A sys path append /usr/local/www/freenasUI N/A N/A N/A N/A sys path append /usr/local/lib N/A N/A N/A os environ N/A DJANGO_SETTINGS_MODULE freenasUI.settings freenasUI.settings LOGGING N/A log N/A N/A logging getLogger tools.updated N/A N/A N/A N/A logging config dictConfig LOGGING freenasOS Update freenasUI.common.log log_traceback freenasUI.system.utils UpdateHandler PidFile N/A object N/A N/A 
    Context manager that locks a pid file.
    Implemented as class not generator because daemon.py is calling __exit__
    with no parameters instead of the None, None, None specified by PEP-343.

    Based on:
    http://code.activestate.com/recipes/
    577911-context-manager-for-a-daemon-pid-file/
     __init__ N/A N/A self path N/A N/A N/A N/A self path path N/A N/A self pidfile None N/A __enter__ N/A N/A self N/A N/A N/A N/A self pidfile N/A open N/A self path a+ N/A N/A N/A N/A N/A fcntl flock N/A N/A N/A self pidfile fileno N/A N/A fcntl LOCK_EX N/A fcntl LOCK_NB N/A N/A N/A IOError N/A N/A N/A SystemExit N/A Already running according to  N/A self path N/A N/A N/A N/A self pidfile seek 0 N/A N/A N/A N/A self pidfile truncate N/A N/A N/A N/A self pidfile write N/A str N/A N/A os getpid N/A N/A N/A N/A self pidfile flush N/A N/A N/A N/A self pidfile seek 0 N/A N/A self pidfile N/A __exit__ N/A N/A self N/A args kwargs N/A N/A N/A N/A N/A N/A N/A os path exists N/A self path N/A N/A N/A N/A os unlink N/A self path N/A N/A N/A N/A self pidfile close N/A N/A N/A IOError N/A N/A N/A N/A main N/A N/A handler args N/A N/A N/A N/A setproctitle updated N/A N/A handler pid N/A N/A os getpid N/A N/A N/A handler dump N/A N/A args download N/A N/A N/A N/A log debug Starting DownloadUpdate N/A N/A N/A Update DownloadUpdate N/A args train N/A args cache check_handler N/A handler get_handler get_handler N/A handler get_file_handler N/A N/A N/A log debug DownloadUpdate finished N/A N/A args apply N/A N/A N/A N/A log debug Starting ApplyUpdate N/A N/A handler reboot N/A N/A Update ApplyUpdate N/A args cache install_handler N/A handler install_handler N/A N/A N/A log debug ApplyUpdate finished N/A N/A N/A __name__ __main__ N/A N/A pidfile N/A PidFile /var/run/updated.pid N/A context N/A N/A daemon DaemonContext working_directory /root umask 2 pidfile pidfile stdout N/A sys stdout stdin N/A sys stdin stderr N/A sys stderr detach_process True N/A parser N/A N/A argparse ArgumentParser N/A N/A N/A parser add_argument -a --apply action store_true help Apply updates N/A N/A N/A parser add_argument -d --download action store_true help Download updates N/A N/A N/A parser add_argument -t --train help Train name N/A N/A N/A parser add_argument -c --cache help Path to the cache directory N/A args N/A N/A parser parse_args N/A handler N/A UpdateHandler apply_ N/A args apply N/A N/A N/A handler dump N/A N/A handler uuid N/A N/A N/A N/A sys stdout flush N/A N/A N/A log debug Entering in daemon mode N/A context N/A N/A N/A N/A log debug Entered in daemon context N/A N/A N/A N/A main handler args N/A N/A N/A Exception N/A e N/A N/A N/A N/A log debug Exception on update N/A N/A log_traceback log log N/A N/A handler error N/A unicode e N/A N/A handler finished True N/A N/A N/A handler dump N/A N/A N/A log debug Exiting daemon process N/A N/A N/A sys exit 0