Module Expr Str Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Str keyword Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad Call AttributeLoad Call NameLoad NameLoad keyword NameLoad attr attr Str Index Num handlers ExceptHandler type NameLoad body Assign NameStore Str If CompareIn NameLoad TupleLoad Str Str body TryExcept body Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad Call AttributeLoad Str attr NameLoad keyword NameLoad Assign NameStore Str handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Raise Assign NameStore Call NameLoad Call NameLoad BinOpMult BinOpDiv Call NameLoad NameLoad NameLoad Num Assign NameStore BinOpAdd Call NameLoad Call NameLoad BinOpMult BinOpDiv Call NameLoad NameLoad NameLoad Num NameLoad If CompareGt NameLoad Num body Assign NameStore Num If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad Str attr NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num NameLoad NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad NameLoad orelse Raise Call NameLoad Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call NameLoad NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad TryExcept body Assign NameStore Call AttributeLoad Call NameLoad NameLoad keyword NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Raise Call NameLoad Call AttributeLoad Str attr NameLoad AttributeLoad NameLoad attr For NameStore SubscriptLoad NameLoad Slice body Expr Call AttributeLoad NameLoad attr Num If Call AttributeLoad NameLoad attr Str body Break Assign NameStore Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad For NameStore NameLoad body Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad Dict Str Str Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Expr Call NameLoad Call AttributeLoad Str attr NameLoad keyword NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Raise decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore ListLoad With Call NameLoad Str Str NameStore body Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Assign NameStore NameLoad For NameStore NameLoad body If BoolOpAnd Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad With Call NameLoad Str Str NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str With Call NameLoad Str Str NameStore body For NameStore Call AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad NameLoad body Return NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Expr Call NameLoad Call AttributeLoad Str attr NameLoad keyword NameLoad Expr Call NameLoad Call AttributeLoad Str attr NameLoad keyword NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Raise decorator_list NameLoad decorator_list
N/A N/A 
Disk module
 N/A re subprocess check_output CalledProcessError ovs.extensions.os.os OSManager ovs.log.logHandler LogHandler N/A logger N/A N/A LogHandler get extensions name disktools DiskTools N/A object N/A N/A 
    This class contains various helper methods wrt Disk maintenance
     create_partition N/A N/A disk_path disk_size partition_start partition_size N/A N/A N/A 
        Creates a partition
        :param disk_path:       Path of disk device
        :type disk_path:        str

        :param disk_size:       Total size of disk
        :type disk_size:        int

        :param partition_start: Start of partition in bytes
        :type partition_start:  int

        :param partition_size:  End of partition in bytes
        :type partition_size:   int

        :return:                None
         N/A N/A N/A command_1 N/A N/A parted {0} print | grep "Partition Table" format disk_path N/A N/A N/A logger info N/A N/A Checking partition label-type with command: {0} format command_1 N/A label_type N/A N/A N/A N/A N/A N/A check_output command_1 shell True strip split :  N/A 1 N/A N/A N/A CalledProcessError N/A N/A label_type error N/A N/A label_type N/A error unknown N/A N/A N/A N/A N/A N/A logger info Adding GPT label and trying to create partition again N/A N/A check_output N/A N/A parted {0} -s mklabel gpt format disk_path shell True N/A label_type gpt N/A N/A N/A Exception N/A ex N/A N/A N/A N/A logger exception N/A N/A Error during label creation: {0} format ex N/A N/A start N/A int N/A round N/A N/A N/A float partition_start disk_size 100 N/A end N/A N/A int N/A round N/A N/A N/A float partition_size disk_size 100 start N/A N/A end 100 N/A N/A end 100 N/A N/A label_type gpt N/A N/A command_2 N/A N/A parted {0} -a optimal -s mkpart {1} {2}% {3}% format disk_path N/A N/A N/A disk_path split / N/A -1 start end N/A N/A N/A label_type msdos N/A N/A command_2 N/A N/A parted {0} -a optimal -s mkpart primary ext4 {1}% {2}% format disk_path start end N/A N/A N/A label_type bsd N/A N/A command_2 N/A N/A parted {0} -a optimal -s mkpart ext4 {1}% {2}% format disk_path start end N/A N/A N/A ValueError N/A N/A Unsupported label-type detected: {0} format label_type N/A N/A N/A logger info N/A N/A Label type detected: {0} format label_type N/A N/A N/A logger info N/A N/A Command to create partition: {0} format command_2 N/A N/A check_output command_2 shell True N/A staticmethod get_partitions_info N/A N/A device N/A N/A N/A 
        Get partitions info from a device
        :param device: device name: /dev/sda

        :return: dict {'partition_device': {'key': 'value'}}
        (!) return values are in B not in sectors
         N/A result N/A N/A command N/A N/A parted -m {0} unit B print -s format device N/A N/A N/A logger debug N/A N/A Checking partitions with command: {0} format command N/A N/A N/A output N/A N/A N/A check_output command shell True splitlines N/A N/A N/A CalledProcessError N/A cpe N/A N/A N/A RuntimeError N/A N/A {0} {1} format cpe N/A cpe output N/A line N/A output N/A N/A N/A N/A N/A output pop 0 N/A N/A N/A line startswith BYT; N/A N/A N/A model_info N/A N/A output pop 0 N/A N/A N/A logger debug N/A N/A Got model info: {0} format model_info N/A line output N/A N/A N/A number start end size fs name flags N/A N/A line split : N/A partition_device N/A N/A {0}{1} format device number N/A N/A result N/A partition_device N/A start end size N/A N/A start rstrip B N/A N/A end rstrip B N/A N/A size rstrip B N/A result N/A staticmethod make_fs N/A N/A partition N/A N/A N/A 
        Creates a filesystem
        :param partition: Path of partition
        :type partition:  str

        :return:          None
         N/A N/A N/A N/A check_output N/A N/A mkfs.ext4 -q {0} format partition shell True N/A N/A N/A Exception N/A ex N/A N/A N/A N/A logger exception N/A N/A Error during filesystem creation: {0} format ex N/A N/A staticmethod add_fstab N/A N/A device mountpoint filesystem N/A N/A N/A 
        Add entry to /etc/fstab for mountpoint
        :param device:     Device to add
        :type device:      str

        :param mountpoint: Mountpoint on which device is mounted
        :type mountpoint:  str

        :param filesystem: Filesystem used
        :type filesystem:  str

        :return:           None
         N/A new_content N/A N/A N/A open /etc/fstab r fstab_file N/A N/A lines N/A N/A N/A line strip N/A line N/A N/A fstab_file readlines N/A found False N/A line lines N/A N/A N/A N/A N/A line startswith device N/A N/A re match N/A N/A ^{0}\s+ format N/A N/A re escape device line N/A N/A N/A N/A new_content append N/A N/A OSManager get_fstab_entry device mountpoint filesystem N/A found True N/A N/A N/A N/A new_content append line N/A N/A found False N/A N/A N/A N/A new_content append N/A N/A OSManager get_fstab_entry device mountpoint filesystem N/A N/A open /etc/fstab w fstab_file N/A N/A N/A N/A fstab_file write N/A N/A {0}
 format N/A N/A join new_content N/A staticmethod mountpoint_exists N/A N/A mountpoint N/A N/A N/A 
        Verify whether a mountpoint exists by browsing /etc/fstab
        :param mountpoint: Mountpoint to check
        :type mountpoint:  str

        :return:           True if mountpoint exists, False otherwise
        :rtype:            bool
         N/A N/A open /etc/fstab r fstab_file N/A N/A line N/A N/A fstab_file readlines N/A N/A N/A N/A re search N/A N/A \s+{0}\s+ format N/A N/A re escape mountpoint line N/A N/A True N/A False N/A staticmethod mount N/A N/A mountpoint N/A N/A N/A 
        Mount a partition
        :param mountpoint: Mountpoint on which to mount the partition
        :type mountpoint:  str

        :return:           None
         N/A N/A N/A N/A check_output N/A N/A mkdir -p {0} format mountpoint shell True N/A N/A check_output N/A N/A mount {0} format mountpoint shell True N/A N/A N/A Exception N/A ex N/A N/A N/A N/A logger exception N/A N/A Error during mount: {0} format ex N/A N/A staticmethod N/A