Module ImportFrom alias ImportFrom alias ImportFrom alias identifier Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias ImportFrom alias identifier ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Expr Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num Assign NameStore Call AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore AttributeLoad AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num attr attr Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore AttributeLoad AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num attr attr Assign SubscriptStore NameLoad Index Str Call NameLoad Call NameLoad BinOpDiv Call NameLoad NameLoad BinOpPow Num Num Num Assign SubscriptStore NameLoad Index Str Call NameLoad Call NameLoad BinOpDiv Call NameLoad NameLoad BinOpPow Num Num Num Assign SubscriptStore NameLoad Index Str Call NameLoad Call NameLoad BinOpDiv Call NameLoad NameLoad BinOpPow Num Num Num Assign NameStore AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num attr For NameStore NameLoad body If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call NameLoad AttributeLoad NameLoad attr For NameStore NameLoad body If CompareEq Call AttributeLoad NameLoad attr Str Str body Assign NameStore Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num attr Str Assign NameStore Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num attr Str Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Dict Str Str Str Str NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Call AttributeLoad NameLoad attr Num Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Str Assign NameStore Dict Str Str Str Str Str Str Dict Str Str Str Num Dict Str Str Str Num Dict Str Str Str Str Str Num Str Call AttributeLoad NameLoad attr Str Str ListLoad ListLoad ListLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Str Str body Assign SubscriptStore NameLoad Index Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign SubscriptStore NameLoad Index Str SubscriptLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Index Num Assign TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Str If CompareNotEq NameLoad Str body Raise Call NameLoad BinOpMod Str NameLoad If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad BinOpMod Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore ListLoad TupleLoad Str Call AttributeLoad NameLoad attr NameLoad TupleLoad Str Call AttributeLoad NameLoad attr NameLoad TupleLoad Str Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr Num NameLoad Assign NameStore ListLoad TupleLoad Str Call AttributeLoad NameLoad attr NameLoad TupleLoad Str Call AttributeLoad NameLoad attr NameLoad TupleLoad Str Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Dict Str Str Str SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str NameLoad Str Str For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr Str ListLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Str If CompareEq SubscriptLoad NameLoad Index Str Str body Assign NameStore BinOpMod Str NameLoad Assign SubscriptStore NameLoad Index Str BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str NameLoad Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Assign NameStore Call NameLoad Call NameLoad NameLoad Assign NameStore BinOpDiv BinOpDiv BinOpDiv Call NameLoad Call NameLoad BinOpMod Str NameLoad Num Num Num If CompareGt NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad NameLoad Expr Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad NameLoad orelse If CompareIn SubscriptLoad NameLoad Index Str ListLoad Str Str body Assign NameStore SubscriptLoad NameLoad Index Str Expr Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Str BinOpPow Num Num Assign SubscriptStore NameLoad Index Str Call NameLoad Call NameLoad Call NameLoad SubscriptLoad NameLoad Index Str Call NameLoad SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index Str Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Str BinOpPow Num Num Assign SubscriptStore NameLoad Index Str Call NameLoad Call NameLoad Call NameLoad SubscriptLoad NameLoad Index Str Call NameLoad SubscriptLoad NameLoad Index Str Assign NameStore ListLoad If CompareGt Call NameLoad SubscriptLoad NameLoad Index Str Call NameLoad SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str If CompareGt Call NameLoad SubscriptLoad NameLoad Index Str Call NameLoad SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Return Call NameLoad Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Return Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpMult Call NameLoad SubscriptLoad NameLoad Index Str BinOpPow Num Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str For NameStore SubscriptLoad NameLoad Index Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num For NameStore SubscriptLoad NameLoad Index Str body If CompareEq SubscriptLoad NameLoad Index Str Str body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr Str Str Str Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq SubscriptLoad NameLoad Index Str Str body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq SubscriptLoad NameLoad Index Str Str body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd NameLoad Num For NameStore SubscriptLoad NameLoad Index Str body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad NameLoad attr Str Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad NameLoad attr Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str NameLoad Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad NameLoad Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpMod Str SubscriptLoad NameLoad Index Str With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpMod Str SubscriptLoad NameLoad Index Str With Call NameLoad Call AttributeLoad NameLoad attr NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr NameLoad For NameStore SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str keyword Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad For NameStore SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call NameLoad NameLoad Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad SubscriptLoad Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Str attr Str Index Num attr Str Assign TupleStore NameStore NameStore TupleLoad Num ListLoad For NameStore NameLoad body If CompareEq Call AttributeLoad NameLoad attr Str Str body AugAssignAdd NameStore Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num Assign NameStore BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareEq Call AttributeLoad NameLoad attr Str Str body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse If CompareEq Call AttributeLoad NameLoad attr Str Str body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Dict Str Str Str Str Str Str Call NameLoad Call NameLoad NameLoad NameLoad NameLoad BinOpMod Str NameLoad BinOpMod Str NameLoad Call NameLoad Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad Call NameLoad attr NameLoad Assign NameStore Call NameLoad BinOpMod Str NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Slice Num Assign NameStore Num For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Assign TupleStore NameStore NameStore TupleLoad Call NameLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num AugAssignAdd NameStore BinOpAdd NameLoad NameLoad Return BinOpMult NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr ListLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword Str keyword Str Expr Call AttributeLoad NameLoad attr NameLoad Str Call NameLoad NameLoad Dict Str BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str AugAssignAdd NameStore Num For TupleStore NameStore NameStore Call NameLoad ListLoad Str Str Str ListComp Call AttributeLoad NameLoad attr BinOpMod Str NameLoad comprehension NameStore ListLoad Str Str Str body If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Dict Str Str Str Str Str Str BinOpMod Str NameLoad Str BinOpMod Str NameLoad Call NameLoad NameLoad Str NameLoad keyword NameLoad AugAssignAdd NameStore Num For TupleStore NameStore NameStore Call NameLoad ListLoad Str Str Str ListComp Call AttributeLoad NameLoad attr BinOpMod Str NameLoad comprehension NameStore ListLoad Str Str Str body If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Dict Str Str Str Str Str Str Str Str BinOpMod Str NameLoad Str BinOpMod Str NameLoad Call NameLoad NameLoad Str NameLoad keyword NameLoad AugAssignAdd NameStore Num Assign NameStore ListLoad For NameStore SubscriptLoad NameLoad Index Str body If CompareEq SubscriptLoad NameLoad Index Str Str body Expr Call AttributeLoad NameLoad attr NameLoad Dict Str Str Str Str Str Str Str Str Str SubscriptLoad NameLoad Index Str Str BinOpMod Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Str BinOpMod Str SubscriptLoad NameLoad Index Str BinOpMod Str NameLoad Str Str Expr Call AttributeLoad NameLoad attr Dict Str Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Str AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore ListLoad For NameStore SubscriptLoad NameLoad Index Str body Assign NameStore Call NameLoad keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Str Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Call NameLoad SubscriptLoad NameLoad Index Str Str NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad For NameStore SubscriptLoad NameLoad Index Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Return IfExp CompareLt Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Num NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad Str attr With Call NameLoad NameLoad Str NameStore body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad Str attr ListLoad Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr ListLoad Call NameLoad NameLoad Call NameLoad NameLoad With Call NameLoad BinOpAdd NameLoad Str Str NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Return Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num Assign NameStore BoolOpOr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Str Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad BinOpMod Str Call AttributeLoad NameLoad attr Str attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Call NameLoad BinOpMod Str Call AttributeLoad NameLoad attr Str attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assert CompareIsNot NameLoad NameLoad Assert CompareEq AttributeLoad NameLoad attr NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Str With Call NameLoad NameLoad Str NameStore body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareIn NameLoad NameLoad body Return SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num Assign NameStore Call NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Return Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Call NameLoad BinOpMod Str Call AttributeLoad NameLoad attr Str attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If CompareIsNot NameLoad NameLoad body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num If CompareIs NameLoad NameLoad body Return Num Assign NameStore TupleLoad SubscriptLoad SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Num Index Num Index Str Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad BinOpMod Str Call AttributeLoad NameLoad attr NameLoad BinOpMult ListLoad Num Num Assign NameStore ListComp BinOpSub NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad TryExcept body Assign NameStore BinOpDiv SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num handlers ExceptHandler type NameLoad body Assign NameStore Num Return NameLoad decorator_list FunctionDef arguments args defaults body Return BinOpDiv SubscriptLoad Call AttributeLoad NameLoad attr Index Str Num decorator_list Return Dict Str Str Call NameLoad Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore ListLoad For NameStore NameLoad body If BoolOpOr CompareNotEq Call AttributeLoad AttributeLoad NameLoad attr attr Str Str CompareNotEq Call AttributeLoad AttributeLoad NameLoad attr attr Str Str body Continue Assign NameStore Call AttributeLoad NameLoad attr Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr Str body Continue If Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Return NameLoad decorator_list
N/A contextlib closing os path xml.etree ElementTree ET N/A libvirt N/A operator N/A os N/A shutil N/A tarfile N/A xml.dom ovf.OvfFile OvfFile ovf.OvfReferencedFile OvfReferencedFile opennode.cli.config get_config opennode.cli.log get_logger opennode.cli.actions.utils execute get_file_size_bytes calculate_hash TemplateException opennode.cli.actions.vm ovfutil opennode.cli.actions sysresources sysres opennode.cli.actions.utils roll_data get_ovf_template_settings N/A N/A ovf_file N/A N/A N/A  Parses ovf file and creates a dictionary of settings  N/A settings N/A read_default_ovf_settings N/A N/A read_ovf_settings settings ovf_file N/A settings N/A get_active_template_settings N/A N/A vm_name storage_pool N/A N/A N/A  Reads libvirt configuration of the specified kvm instance  N/A settings N/A read_default_ovf_settings N/A kvm_xml_dom N/A get_libvirt_conf_xml vm_name N/A domain_dom N/A N/A N/A kvm_xml_dom getElementsByTagName domain N/A 0 N/A interface_list_dom N/A N/A domain_dom getElementsByTagName interface N/A os_dom N/A N/A N/A domain_dom getElementsByTagName os N/A 0 N/A os_type_dom N/A N/A N/A os_dom getElementsByTagName type N/A 0 N/A os_arch N/A N/A os_type_dom getAttribute arch N/A N/A settings N/A arch os_arch N/A vcpu_count N/A N/A N/A N/A N/A domain_dom getElementsByTagName vcpu N/A 0 firstChild nodeValue N/A N/A settings N/A vcpu vcpu_count N/A N/A settings N/A min_vcpu vcpu_count N/A N/A settings N/A max_vcpu vcpu_count N/A memory_count N/A N/A N/A N/A N/A domain_dom getElementsByTagName memory N/A 0 firstChild nodeValue N/A N/A settings N/A memory N/A str N/A round N/A N/A float memory_count N/A 1024 2 3 N/A N/A settings N/A min_memory N/A str N/A round N/A N/A float memory_count N/A 1024 2 3 N/A N/A settings N/A max_memory N/A str N/A round N/A N/A float memory_count N/A 1024 2 3 N/A features_dom_list N/A N/A N/A N/A domain_dom getElementsByTagName features N/A 0 childNodes N/A feature features_dom_list N/A N/A N/A N/A feature nodeType N/A feature ELEMENT_NODE N/A N/A N/A N/A N/A settings N/A features append N/A str N/A feature nodeName N/A interface_dom interface_list_dom N/A N/A N/A N/A N/A interface_dom getAttribute type bridge N/A N/A mac_address N/A N/A N/A N/A N/A interface_dom getElementsByTagName mac N/A 0 getAttribute address N/A bridge_name N/A N/A N/A N/A N/A interface_dom getElementsByTagName source N/A 0 getAttribute bridge N/A N/A N/A N/A settings N/A interfaces append N/A type source_bridge mac_address bridge bridge_name mac_address N/A settings N/A get_libvirt_conf_xml N/A N/A vm_name N/A N/A N/A conn N/A N/A libvirt open qemu:///system N/A vm N/A N/A conn lookupByName vm_name N/A document N/A N/A N/A N/A xml dom minidom parseString N/A N/A vm XMLDesc 0 N/A document N/A read_default_ovf_settings N/A N/A N/A N/A N/A  Reads default ovf configuration from file, returns a dictionary of settings. N/A config N/A get_config kvm N/A settings N/A serial console graphics interfaces features disks N/A type target_port pty 0 N/A type target_port pty 0 N/A type port autoport keymap vnc -1 yes N/A N/A config getstring vnc keymap N/A N/A N/A N/A N/A N/A settings update N/A dict N/A N/A config getlist ovf-defaults N/A N/A N/A N/A N/A os path exists N/A N/A settings get emulator N/A N/A N/A settings N/A emulator /usr/bin/kvm N/A settings N/A read_ovf_settings N/A N/A settings ovf_file N/A N/A N/A 
    Parses OVF template/appliance XML configuration and save parsed settings.

    @return: Parsed OVF template/appliance XML configuration settings
    @rtype: Dictionary
     N/A N/A settings N/A template_name N/A N/A N/A path splitext N/A N/A path basename N/A ovf_file path N/A 0 N/A N/A sys_type sys_arch N/A N/A N/A N/A ovfutil get_vm_type ovf_file split - N/A N/A sys_type kvm N/A N/A N/A TemplateException N/A The chosen template '%s' cannot run on KVM hypervisor. sys_type N/A N/A sys_arch N/A x86_64 i686 N/A N/A N/A TemplateException N/A Template architecture '%s' is not supported. sys_arch N/A N/A settings N/A arch sys_arch N/A memory_settings N/A N/A memory_min N/A N/A ovfutil get_ovf_min_memory_gb ovf_file N/A memory N/A N/A ovfutil get_ovf_normal_memory_gb ovf_file N/A memory_max N/A N/A ovfutil get_ovf_max_memory_gb ovf_file N/A N/A N/A settings update N/A dict N/A filter N/A N/A operator itemgetter 1 memory_settings N/A vcpu_settings N/A N/A vcpu_min N/A N/A ovfutil get_ovf_min_vcpu ovf_file N/A vcpu_normal N/A N/A ovfutil get_ovf_normal_vcpu ovf_file N/A vcpu_max N/A N/A ovfutil get_ovf_max_vcpu ovf_file N/A N/A N/A settings update N/A dict N/A filter N/A N/A operator itemgetter 1 vcpu_settings N/A network_list N/A N/A ovfutil get_networks ovf_file N/A network network_list N/A N/A N/A N/A N/A settings N/A interfaces append N/A type source_bridge bridge N/A network N/A sourceName N/A N/A settings N/A disks N/A N/A ovfutil get_disks ovf_file N/A N/A settings N/A features N/A N/A ovfutil get_openode_features ovf_file N/A N/A settings N/A passwd N/A N/A ovfutil get_root_password ovf_file N/A N/A settings N/A username N/A N/A ovfutil get_admin_username ovf_file N/A settings N/A deploy N/A N/A settings storage_pool N/A N/A N/A log N/A get_logger N/A N/A N/A log info Copying KVM template disks (this may take a while)... N/A N/A prepare_file_system settings storage_pool N/A N/A N/A log info Generating KVM VM configuration... N/A libvirt_conf_dom N/A generate_libvirt_conf settings N/A N/A N/A log info Finalyzing KVM template deployment... N/A conn N/A N/A libvirt open qemu:///system N/A N/A N/A conn defineXML N/A N/A libvirt_conf_dom toxml N/A N/A N/A log info Deployment done! N/A prepare_file_system N/A N/A settings storage_pool N/A N/A N/A 
    Prepare file system for VM template creation in OVF appliance format:
        - create template directory if it does not exist
        - copy disk based images
        - convert block device based images to file based images
     N/A config N/A get_config N/A log N/A get_logger N/A images_dir N/A N/A path join N/A N/A config getstring general storage-endpoint storage_pool images N/A target_dir N/A N/A path join N/A N/A config getstring general storage-endpoint storage_pool kvm unpacked N/A N/A disk_index disk N/A enumerate N/A N/A settings get disks N/A N/A N/A disk_template_path N/A N/A path join target_dir N/A disk N/A template_name N/A N/A N/A disk N/A deploy_type file N/A N/A volume_name N/A disk%s disk_index N/A N/A disk N/A source_file N/A %s-%s-%s.%s N/A N/A settings N/A hostname N/A settings N/A uuid volume_name N/A N/A disk get template_format qcow2 N/A disk_deploy_path N/A N/A path join images_dir N/A disk N/A source_file N/A N/A N/A shutil copy2 disk_template_path disk_deploy_path N/A diskspace N/A N/A settings get disk N/A diskspace N/A N/A diskspace N/A int N/A float diskspace N/A current_size N/A N/A N/A N/A int N/A execute N/A qemu-img info %s |grep 'virtual size' |awk '{print $4}' |cut -b2-  disk_deploy_path 1024 1024 1024 N/A N/A diskspace current_size N/A N/A N/A N/A log info N/A Increasing image file %s from %s to %sG N/A disk_deploy_path current_size diskspace N/A N/A execute N/A qemu-img resize %s %sG N/A disk_deploy_path diskspace N/A N/A N/A N/A log info N/A Ignoring disk (%s) increase request (to %s) as existing image is already larger (%s) N/A disk_deploy_path diskspace current_size N/A N/A N/A N/A disk N/A deploy_type N/A physical lvm N/A N/A disk_deploy_path N/A disk N/A source_dev N/A N/A execute N/A qemu-img convert -f qcow2 -O raw %s %s N/A disk_template_path disk_deploy_path N/A adjust_setting_to_systems_resources N/A N/A ovf_template_settings N/A N/A N/A 
    Adjusts maximum required resources to match available system resources.
    NB! Minimum bound is not adjusted.
     N/A st ovf_template_settings N/A N/A st N/A memory_max N/A str N/A min N/A N/A sysres get_ram_size_gb N/A float N/A N/A st get memory_max N/A 10 30 N/A N/A st N/A memory N/A str N/A min N/A float N/A st N/A memory N/A float N/A st N/A memory_max N/A N/A st N/A vcpu_max N/A str N/A min N/A N/A sysres get_cpu_count N/A int N/A N/A st get vcpu_max N/A 10 10 N/A N/A st N/A vcpu N/A str N/A min N/A int N/A st N/A vcpu N/A int N/A st N/A vcpu_max N/A errors N/A N/A N/A N/A float N/A st N/A memory_min N/A float N/A st N/A memory_max N/A N/A N/A N/A errors append N/A Minimum required memory %sGB exceeds total available memory %sGB N/A N/A st N/A memory_min N/A st N/A memory_max N/A N/A N/A int N/A st N/A vcpu_min N/A int N/A st N/A vcpu_max N/A N/A N/A N/A errors append N/A Minimum required number of vcpus %s exceeds available number %s. N/A N/A st N/A vcpu_min N/A st N/A vcpu_max N/A errors N/A get_available_instances N/A N/A N/A N/A N/A Return a list of defined KVM VMs N/A conn N/A N/A libvirt open qemu:///system N/A name_list N/A N/A conn listDefinedDomains N/A N/A dict N/A zip name_list name_list N/A get_all_instances N/A N/A N/A N/A N/A Return all defined KVM VMs N/A N/A get_available_instances N/A generate_libvirt_conf N/A N/A settings N/A N/A N/A 
    Prepare Libvirt XML configuration file from OVF template/appliance.

    @return: Libvirt XML configuration
    @rtype: DOM Document
     N/A libvirt_conf_dom N/A N/A N/A N/A xml dom minidom Document N/A domain_dom N/A N/A libvirt_conf_dom createElement domain N/A N/A N/A domain_dom setAttribute type N/A settings N/A domain_type N/A N/A N/A libvirt_conf_dom appendChild domain_dom N/A name_dom N/A N/A libvirt_conf_dom createElement name N/A name_value N/A N/A libvirt_conf_dom createTextNode N/A settings N/A hostname N/A N/A N/A name_dom appendChild name_value N/A N/A N/A domain_dom appendChild name_dom N/A uuid_dom N/A N/A libvirt_conf_dom createElement uuid N/A uuid_value N/A N/A libvirt_conf_dom createTextNode N/A settings N/A uuid N/A N/A N/A uuid_dom appendChild uuid_value N/A N/A N/A domain_dom appendChild uuid_dom N/A memory_dom N/A N/A libvirt_conf_dom createElement memory N/A memory_value N/A N/A libvirt_conf_dom createTextNode N/A str N/A int N/A N/A float N/A settings N/A memory N/A 1024 2 N/A N/A N/A memory_dom appendChild memory_value N/A N/A N/A domain_dom appendChild memory_dom N/A vcpu_dom N/A N/A libvirt_conf_dom createElement vcpu N/A vcpu_value N/A N/A libvirt_conf_dom createTextNode N/A str N/A settings N/A vcpu N/A N/A N/A vcpu_dom appendChild vcpu_value N/A N/A N/A domain_dom appendChild vcpu_dom N/A os_dom N/A N/A libvirt_conf_dom createElement os N/A os_type_dom N/A N/A libvirt_conf_dom createElement type N/A N/A N/A os_type_dom setAttribute arch N/A settings N/A arch N/A N/A N/A os_type_dom setAttribute machine N/A settings N/A machine N/A os_type_value N/A N/A libvirt_conf_dom createTextNode N/A settings N/A virt_type N/A N/A N/A os_type_dom appendChild os_type_value N/A N/A N/A os_dom appendChild os_type_dom N/A os_boot_dom N/A N/A libvirt_conf_dom createElement boot N/A N/A N/A os_boot_dom setAttribute dev N/A settings N/A boot_dev N/A N/A N/A os_dom appendChild os_boot_dom N/A N/A N/A domain_dom appendChild os_dom N/A features_dom N/A N/A libvirt_conf_dom createElement features N/A feature N/A settings N/A features N/A N/A feature_dom N/A N/A libvirt_conf_dom createElement feature N/A N/A N/A features_dom appendChild feature_dom N/A N/A N/A domain_dom appendChild features_dom N/A clock_dom N/A N/A libvirt_conf_dom createElement clock N/A N/A N/A clock_dom setAttribute offset N/A settings N/A clock_offset N/A N/A N/A domain_dom appendChild clock_dom N/A timer_dom N/A N/A libvirt_conf_dom createElement timer N/A N/A N/A timer_dom setAttribute name rtc N/A N/A N/A timer_dom setAttribute tickpolicy catchup N/A N/A N/A clock_dom appendChild timer_dom N/A on_poweroff_dom N/A N/A libvirt_conf_dom createElement on_poweroff N/A on_poweroff_value N/A N/A libvirt_conf_dom createTextNode N/A settings N/A on_poweroff N/A N/A N/A on_poweroff_dom appendChild on_poweroff_value N/A N/A N/A domain_dom appendChild on_poweroff_dom N/A on_reboot_dom N/A N/A libvirt_conf_dom createElement on_reboot N/A on_reboot_value N/A N/A libvirt_conf_dom createTextNode N/A settings N/A on_reboot N/A N/A N/A on_reboot_dom appendChild on_reboot_value N/A N/A N/A domain_dom appendChild on_reboot_dom N/A on_crash_dom N/A N/A libvirt_conf_dom createElement on_crash N/A on_crash_value N/A N/A libvirt_conf_dom createTextNode N/A settings N/A on_crash N/A N/A N/A on_crash_dom appendChild on_crash_value N/A N/A N/A domain_dom appendChild on_crash_dom N/A devices_dom N/A N/A libvirt_conf_dom createElement devices N/A N/A N/A domain_dom appendChild devices_dom N/A emulator_dom N/A N/A libvirt_conf_dom createElement emulator N/A emulator_value N/A N/A libvirt_conf_dom createTextNode N/A settings N/A emulator N/A N/A N/A emulator_dom appendChild emulator_value N/A N/A N/A devices_dom appendChild emulator_dom N/A drive_letter_count 0 N/A disk N/A settings N/A disks N/A N/A N/A N/A disk N/A deploy_type file N/A N/A disk_dom N/A N/A libvirt_conf_dom createElement disk N/A N/A N/A disk_dom setAttribute type N/A disk N/A type N/A N/A N/A disk_dom setAttribute device N/A disk N/A device N/A N/A N/A devices_dom appendChild disk_dom N/A driver_dom N/A N/A libvirt_conf_dom createElement driver N/A N/A N/A driver_dom setAttribute name qemu N/A N/A N/A driver_dom setAttribute type N/A N/A disk get template_format qcow2 N/A N/A N/A driver_dom setAttribute cache none N/A N/A N/A disk_dom appendChild driver_dom N/A disk_source_dom N/A N/A libvirt_conf_dom createElement source N/A config N/A get_config N/A image_path N/A N/A path join N/A N/A config getstring general storage-endpoint N/A N/A config getstring general default-storage-pool images N/A N/A N/A disk_source_dom setAttribute file N/A N/A path join image_path N/A disk N/A source_file N/A N/A N/A disk_dom appendChild disk_source_dom N/A disk_target_dom N/A N/A libvirt_conf_dom createElement target N/A N/A N/A disk_target_dom setAttribute dev N/A disk N/A target_dev N/A N/A N/A disk_target_dom setAttribute bus N/A disk N/A target_bus N/A N/A N/A disk_dom appendChild disk_target_dom N/A N/A N/A N/A disk N/A deploy_type physical N/A N/A disk_dom N/A N/A libvirt_conf_dom createElement disk N/A N/A N/A disk_dom setAttribute type N/A disk N/A type N/A N/A N/A disk_dom setAttribute device N/A disk N/A device N/A N/A N/A devices_dom appendChild disk_dom N/A driver_dom N/A N/A libvirt_conf_dom createElement driver N/A N/A N/A driver_dom setAttribute name qemu N/A N/A N/A driver_dom setAttribute cache none N/A N/A N/A devices_dom appendChild driver_dom N/A disk_source_dom N/A N/A libvirt_conf_dom createElement source N/A N/A N/A disk_source_dom setAttribute dev N/A disk N/A source_dev N/A N/A N/A disk_dom appendChild disk_source_dom N/A disk_target_dom N/A N/A libvirt_conf_dom createElement target N/A N/A N/A disk_target_dom setAttribute dev N/A disk N/A target_dev N/A N/A N/A disk_target_dom setAttribute bus N/A disk N/A target_bus N/A N/A N/A disk_dom appendChild disk_target_dom N/A N/A N/A N/A disk N/A deploy_type lvm N/A N/A disk_dom N/A N/A libvirt_conf_dom createElement disk N/A N/A N/A disk_dom setAttribute type N/A disk N/A type N/A N/A N/A disk_dom setAttribute device N/A disk N/A device N/A N/A N/A devices_dom appendChild disk_dom N/A disk_source_dom N/A N/A libvirt_conf_dom createElement source N/A N/A N/A disk_source_dom setAttribute dev N/A disk N/A source_dev N/A N/A N/A disk_dom appendChild disk_source_dom N/A disk_target_dom N/A N/A libvirt_conf_dom createElement target N/A N/A N/A disk_target_dom setAttribute dev N/A disk N/A target_dev N/A N/A N/A disk_target_dom setAttribute bus N/A disk N/A target_bus N/A N/A N/A disk_dom appendChild disk_target_dom N/A drive_letter_count N/A drive_letter_count 1 N/A interface N/A settings N/A interfaces N/A N/A interface_dom N/A N/A libvirt_conf_dom createElement interface N/A N/A N/A interface_dom setAttribute type N/A interface N/A type N/A N/A N/A devices_dom appendChild interface_dom N/A interface_source_dom N/A N/A libvirt_conf_dom createElement source N/A N/A N/A interface_source_dom setAttribute bridge N/A interface N/A source_bridge N/A N/A N/A interface_dom appendChild interface_source_dom N/A N/A mac interface N/A N/A interface_mac_dom N/A N/A libvirt_conf_dom createElement mac N/A N/A N/A interface_mac_dom setAttribute address N/A interface N/A mac N/A N/A N/A interface_dom appendChild interface_mac_dom N/A N/A N/A mac_address settings N/A N/A interface_mac_dom N/A N/A libvirt_conf_dom createElement mac N/A N/A N/A interface_mac_dom setAttribute address N/A settings N/A mac_address N/A N/A N/A interface_dom appendChild interface_mac_dom N/A N/A ip_address settings N/A N/A interface_filter_dom N/A N/A libvirt_conf_dom createElement filterref N/A N/A N/A interface_filter_dom setAttribute filter clean-traffic N/A N/A N/A interface_dom appendChild interface_filter_dom N/A interface_filter_ip_dom N/A N/A libvirt_conf_dom createElement parameter N/A N/A N/A interface_filter_ip_dom setAttribute name IP N/A N/A N/A interface_filter_ip_dom setAttribute value N/A settings N/A ip_address N/A N/A N/A interface_filter_dom appendChild interface_filter_ip_dom N/A serial_dom N/A N/A libvirt_conf_dom createElement serial N/A N/A N/A serial_dom setAttribute type N/A N/A settings N/A serial N/A type N/A N/A N/A devices_dom appendChild serial_dom N/A serial_target_dom N/A N/A libvirt_conf_dom createElement target N/A N/A N/A serial_target_dom setAttribute port N/A str N/A N/A settings N/A serial N/A target_port N/A N/A N/A serial_dom appendChild serial_target_dom N/A console_dom N/A N/A libvirt_conf_dom createElement console N/A N/A N/A console_dom setAttribute type N/A N/A settings N/A console N/A type N/A N/A N/A devices_dom appendChild console_dom N/A console_target_dom N/A N/A libvirt_conf_dom createElement target N/A N/A N/A console_target_dom setAttribute port N/A str N/A N/A settings N/A console N/A target_port N/A N/A N/A console_dom appendChild console_target_dom N/A input_type_dom N/A N/A libvirt_conf_dom createElement input N/A N/A N/A input_type_dom setAttribute type mouse N/A N/A N/A input_type_dom setAttribute bus N/A settings N/A mouse_bus N/A N/A N/A devices_dom appendChild input_type_dom N/A graphics_dom N/A N/A libvirt_conf_dom createElement graphics N/A N/A N/A graphics_dom setAttribute type N/A N/A settings N/A graphics N/A type N/A N/A N/A graphics_dom setAttribute port N/A str N/A N/A settings N/A graphics N/A port N/A N/A N/A graphics_dom setAttribute autoport N/A N/A settings N/A graphics N/A autoport N/A N/A N/A graphics_dom setAttribute keymap N/A N/A settings N/A graphics N/A keymap N/A N/A N/A devices_dom appendChild graphics_dom N/A libvirt_conf_dom N/A save_as_ovf N/A N/A vm_settings storage_pool unpack N/A True N/A N/A 
    Creates ovf template archive for the specified VM.
    Steps:
        - relocate kvm disk files
        - generate ovf configuration file
        - pack ovf and disk files into tar.gz file
        - (if unpack) leave generated files as unpacked
     N/A config N/A get_config N/A log N/A get_logger N/A target_dir N/A N/A path join N/A N/A config getstring general storage-endpoint storage_pool kvm N/A unpack N/A N/A target_dir N/A N/A path join target_dir unpacked N/A msg Preparing disks... (This may take a while) N/A N/A N/A log info msg N/A N/A vm_settings N/A disks N/A _prepare_disks vm_settings target_dir N/A msg Generating ovf file... N/A N/A N/A log info msg N/A ovf N/A _generate_ovf_file vm_settings N/A ovf_fnm N/A N/A path join target_dir N/A %s.ovf N/A vm_settings N/A template_name N/A N/A open ovf_fnm w f N/A N/A N/A N/A ovf writeFile f pretty True encoding UTF-8 N/A msg Archiving... N/A N/A N/A log info msg N/A arch_location N/A N/A path join N/A N/A config getstring general storage-endpoint storage_pool kvm N/A ovf_archive_fnm N/A N/A path join arch_location N/A %s.ova N/A vm_settings N/A template_name N/A N/A closing N/A N/A tarfile open ovf_archive_fnm w tar N/A N/A N/A N/A tar add ovf_fnm arcname N/A N/A path basename ovf_fnm N/A disk N/A vm_settings N/A disks N/A N/A N/A N/A tar add N/A disk N/A new_path arcname N/A N/A path basename N/A disk N/A new_path N/A N/A unpack N/A N/A N/A N/A os remove ovf_fnm N/A disk N/A vm_settings N/A disks N/A N/A N/A N/A os remove N/A disk N/A new_path N/A N/A calculate_hash ovf_archive_fnm N/A msg N/A Done! Template saved at %s ovf_archive_fnm N/A N/A N/A log info msg N/A _prepare_disks N/A N/A vm_settings target_dir N/A N/A N/A 
    Prepare VM disks for OVF appliance creation.
    File based disks will be copied to VM creation directory.
    LVM and block-device based disks will be converted into file based images and copied to creation directory.

    @param target_dir: directory where disks will be copied
     N/A disk_list_dom N/A N/A N/A N/A N/A N/A get_libvirt_conf_xml N/A vm_settings N/A vm_name getElementsByTagName domain N/A 0 getElementsByTagName disk N/A N/A disk_num disk_list N/A 0 N/A N/A disk_dom disk_list_dom N/A N/A N/A N/A N/A disk_dom getAttribute device disk N/A N/A disk_num 1 N/A source_dom N/A N/A N/A disk_dom getElementsByTagName source N/A 0 N/A filename N/A %s%d.img N/A N/A vm_settings N/A template_name disk_num N/A new_path N/A N/A path join target_dir filename N/A N/A N/A N/A disk_dom getAttribute type file N/A N/A disk_path N/A N/A source_dom getAttribute file N/A N/A N/A shutil copy2 disk_path new_path N/A N/A N/A N/A N/A disk_dom getAttribute type block N/A N/A source_dev N/A N/A source_dom getAttribute dev N/A N/A execute N/A qemu-img convert -f raw -O qcow2 %s %s N/A source_dev new_path N/A disk_dict N/A file_size filename new_path file_id disk_id disk_capacity N/A str N/A get_file_size_bytes new_path filename new_path N/A diskfile%d disk_num N/A vmdisk%d.img disk_num N/A str N/A get_kvm_disk_capacity_bytes new_path N/A N/A N/A disk_list append disk_dict N/A disk_list N/A get_kvm_disk_capacity_bytes N/A N/A path N/A N/A N/A msg N/A Getting capacity of the kvm disk '%s' path N/A N/A N/A N/A get_logger info msg N/A res N/A execute N/A virt-df --csv %s path N/A rows N/A N/A N/A res split N/A 2 N/A capacity 0 N/A row rows N/A N/A row_elements N/A N/A row split , N/A N/A used available N/A N/A int N/A row_elements N/A 3 N/A int N/A row_elements N/A 4 N/A capacity N/A used available N/A N/A capacity 1024 N/A _generate_ovf_file N/A N/A vm_settings N/A N/A N/A 
    Prepare OVF XML configuration file from Libvirt's KVM xml_dump.

    @return: KVM VM configuration in OVF standard
    @rtype: DOM Document
     N/A ovf N/A OvfFile N/A N/A ovf files N/A N/A N/A N/A ovf createEnvelope N/A N/A N/A N/A ovf envelope setAttribute xmlns:opennodens http://opennodecloud.com/schema/ovf/opennodens/1 N/A instanceId 0 N/A virtualSystem N/A N/A ovf createVirtualSystem ident N/A vm_settings N/A template_name info KVM OpenNode template N/A hardwareSection N/A N/A ovf createVirtualHardwareSection node virtualSystem ident virtual_hardware info Virtual hardware requirements for a virtual machine N/A N/A N/A ovf createSystem hardwareSection Virtual Hardware Family N/A str instanceId N/A VirtualSystemType N/A %s-%s N/A N/A vm_settings N/A domain_type N/A vm_settings N/A arch N/A instanceId 1 N/A N/A bound cpu N/A zip N/A normal min max N/A N/A N/A vm_settings get N/A vcpu%s pfx N/A pfx N/A _min _max N/A N/A cpu N/A N/A N/A N/A ovf addResourceItem hardwareSection N/A Caption Description ElementName InstanceID ResourceType VirtualQuantity N/A %s virtual CPU cpu Number of virtual CPUs N/A %s virtual CPU cpu N/A str instanceId 3 cpu bound bound N/A instanceId 1 N/A N/A bound memory N/A zip N/A normal min max N/A N/A N/A vm_settings get N/A memory%s pfx N/A pfx N/A _min _max N/A N/A memory N/A N/A N/A N/A ovf addResourceItem hardwareSection N/A AllocationUnits Caption Description ElementName InstanceID ResourceType VirtualQuantity GigaBytes N/A %s GB of memory memory Memory Size N/A %s GB of memory memory N/A str instanceId 4 memory bound bound N/A instanceId 1 N/A network_list N/A N/A interface N/A vm_settings N/A interfaces N/A N/A N/A N/A interface N/A type bridge N/A N/A N/A N/A ovf addResourceItem hardwareSection N/A Address AutomaticAllocation Caption Connection Description ElementName InstanceID ResourceSubType ResourceType N/A interface N/A mac_address true N/A Ethernet adapter on '%s' N/A interface N/A source_bridge N/A interface N/A source_bridge Network interface N/A Ethernet adapter on '%s' N/A interface N/A source_bridge N/A %d instanceId E1000 10 N/A N/A N/A network_list append N/A networkID networkName description N/A interface N/A source_bridge N/A interface N/A source_bridge Network for OVF appliance N/A instanceId 1 N/A N/A N/A ovf createNetworkSection network_list Network for OVF appliance N/A ovf_disk_list N/A N/A disk N/A vm_settings N/A disks N/A N/A ref_file N/A OvfReferencedFile path N/A disk N/A new_path href N/A disk N/A filename file_id N/A disk N/A file_id size N/A disk N/A file_size N/A N/A N/A ovf addReferencedFile ref_file N/A N/A N/A ovf_disk_list append N/A diskId fileRef capacity format parentRef populatedSize capacityAllocUnits N/A disk N/A disk_id N/A disk N/A file_id N/A str N/A disk N/A disk_capacity qcow2 None None None N/A N/A N/A ovf createReferences N/A N/A N/A ovf createDiskSection ovf_disk_list KVM VM template disks N/A doc N/A N/A N/A N/A xml dom minidom Document N/A on_section N/A N/A doc createElement opennodens:OpenNodeSection N/A N/A N/A on_section setAttribute ovf:required false N/A N/A N/A virtualSystem appendChild on_section N/A info_dom N/A N/A doc createElement Info N/A N/A N/A on_section appendChild info_dom N/A info_value N/A N/A doc createTextNode OpenNode Section for template customization N/A N/A N/A info_dom appendChild info_value N/A features_dom N/A N/A doc createElement Features N/A N/A N/A on_section appendChild features_dom N/A admin_password N/A N/A doc createElement AdminPassword N/A N/A N/A on_section appendChild admin_password N/A password_value N/A N/A doc createTextNode N/A vm_settings N/A passwd N/A N/A N/A admin_password appendChild password_value N/A feature N/A vm_settings N/A features N/A N/A feature_dom N/A N/A doc createElement feature N/A N/A N/A features_dom appendChild feature_dom N/A ovf N/A get_id_by_uuid N/A N/A conn uuid backend N/A qemu:///system N/A N/A N/A N/A N/A N/A N/A N/A conn lookupByUUIDString uuid ID 0 None N/A N/A N/A N/A conn lookupByUUIDString uuid ID N/A set_owner N/A N/A conn uuid owner N/A N/A N/A Set ON_OWNER by uuid.
    @param uuid: uuid of the VM
    @param owner: string representing owner
     N/A owners_file /etc/opennode/kvmowners N/A N/A N/A N/A N/A os path exists owners_file N/A N/A N/A N/A N/A open owners_file a close N/A N/A open owners_file rt f N/A N/A kvmowners N/A N/A f read N/A kvmowners N/A N/A kvmowners split N/A added False N/A N/A k v N/A enumerate kvmowners N/A N/A N/A uuid v N/A N/A N/A kvmowners N/A k N/A N/A = join N/A N/A str uuid N/A str owner N/A added True N/A N/A added N/A N/A N/A N/A kvmowners append N/A N/A = join N/A N/A str uuid N/A str owner N/A N/A open N/A owners_file .new wt f N/A N/A N/A N/A f write N/A N/A join kvmowners N/A N/A N/A os rename owners_file N/A owners_file .bak N/A N/A N/A os rename N/A owners_file .new owners_file N/A vmid N/A get_id_by_uuid conn uuid N/A N/A vmid N/A N/A N/A vm N/A N/A conn lookupByID vmid N/A domain N/A N/A ET fromstring N/A N/A vm XMLDesc 0 N/A metadata N/A N/A N/A domain find ./metadata N/A N/A ET SubElement domain metadata N/A owner_e N/A N/A ET SubElement metadata N/A N/A ET QName urn:opennode-tui owner N/A N/A owner_e text owner N/A N/A N/A N/A open N/A /etc/libvirt/qemu/%s.xml N/A N/A vm name w write N/A N/A ET tostring domain N/A data N/A N/A N/A open N/A /etc/libvirt/qemu/%s.xml N/A N/A vm name r read N/A domain_n N/A N/A ET fromstring data N/A owner_e N/A N/A domain_n find ./metadata/{urn:opennode-tui}owner N/A N/A owner_e None N/A N/A N/A owner_e text owner N/A N/A owner_e text N/A get_owner N/A N/A conn uuid N/A N/A N/A Get VM owner by id
    @param uuid: uuid of the VM
     N/A owners_file /etc/opennode/kvmowners N/A N/A open owners_file rt f N/A N/A kvmowners N/A N/A f read N/A kvmowners N/A N/A kvmowners split N/A N/A k v N/A enumerate kvmowners N/A N/A N/A uuid v N/A N/A N/A N/A N/A v split = N/A 1 N/A vmid N/A get_id_by_uuid conn uuid N/A N/A vmid N/A N/A N/A vm N/A N/A conn lookupByID vmid N/A data N/A N/A N/A open N/A /etc/libvirt/qemu/%s.xml N/A N/A vm name r read N/A domain N/A N/A ET fromstring data N/A owner N/A N/A domain find ./metadata/{urn:opennode-tui}owner N/A N/A owner None N/A N/A N/A owner text N/A vm_metrics N/A N/A conn vm N/A N/A cpu_usage N/A N/A N/A N/A N/A hn_stats N/A N/A conn getCPUStats True 0 N/A N/A hn_stats None N/A N/A 0.0 N/A time_now N/A N/A N/A N/A N/A vm getCPUStats True 0 N/A 0 N/A cpu_time N/A sum N/A N/A hn_stats itervalues N/A time_was N/A roll_data N/A /tmp/kvm-vm-cpu-%s N/A N/A vm ID time_now N/A N/A 0 6 N/A deltas N/A N/A yi xi N/A N/A yi xi N/A zip time_now time_was N/A N/A N/A cpu_pct N/A N/A deltas N/A 0 N/A float N/A deltas N/A 1 N/A N/A N/A ZeroDivisionError N/A N/A cpu_pct 0 N/A cpu_pct N/A memory_usage N/A N/A N/A N/A N/A N/A N/A N/A N/A vm memoryStats N/A rss 1024.0 N/A N/A N/A cpu_usage memory_usage N/A cpu_usage N/A memory_usage N/A compile_cleanup N/A N/A conn vm N/A N/A N/A domain N/A N/A ET fromstring N/A N/A vm XMLDesc 0 N/A disk_elements N/A N/A domain findall ./devices/disk N/A cleanup_list N/A N/A disk disk_elements N/A N/A N/A N/A N/A N/A N/A disk attrib get type file N/A N/A N/A N/A disk attrib get device disk N/A N/A N/A source N/A N/A disk find ./source N/A N/A N/A N/A N/A source attrib get file N/A N/A N/A N/A N/A N/A os path exists N/A N/A N/A source attrib get file N/A N/A N/A N/A cleanup_list append N/A N/A N/A source attrib get file N/A cleanup_list N/A