* Check mount output to detect already mounted resource disk (#600)
mount(8) returns '32' in a variety of cases, we need to check the output
to be sure the resource disk is already mounted.
* Pass '-n' to sfdisk when not writing
Some old versions of sfdisk(8) will open block device in O_RDWR mode regardless
of the face that we're actually just querying partition type and not changing
it and if device is opened in this mode it will trigger partition rescan when
it is closed. This creates a race as partitions (/dev/sd*) will be going away
and re-appear later. Specify '-n' to indicate no write is required, sfdisk(8)
always opens the device in O_RDONLY now.
* Re-read partition table after changing partition type
Some old sfdisk(8) versions don't do syncronious partition re-read after
making changes. The kernel will re-read it anyway in background but this
will cause races with further mkfs as partition devices will be
disappearing. Do explicit partition rescan after we change partition id.
With recent versions of sfdisk the -c command is deprecated and
--part-type is recommended to be used instead. This use also requires
the output to be stripped instead of rstripped due to a leading space.
* add testing for mountpoint, some refactoring
* fixed double space in mount string
* patch for ConfigProvider
* revert patch to original string.
* update documentation, add 'n' option for mountopts
* remove test argument
* More descriptive description in README, n to None
* minor var name changes for clarity
* spacing, missing self in get_mount_string
* mount_opts to mount_options
* add config option to writtet WaagentConf, minor style changes.
* mount options fix, is not Note
* add self to get_mount_string args
* self to function, not where it's called
* mount_options = output of function, not the function.
* get_mount_string returns with mount options/if not none
* forgot to remove part of the string
* instantiate resource disk handler, get_switch to get in conf.py
* Added config option to waagent.conf
* minor style fixes
* mountOpts is None change, and also added removed variable.
* revert changes to bin/waagent2.0
* reverted waagent2.0 to e8c641f
* config options added