--- /dev/null
+"""
+Collection of remote functions that are specific to a given platform
+"""
+import platform
+
+
+def platform_information():
+ """ detect platform information from remote host """
+ distro, release, codename = platform.linux_distribution()
+ return (
+ str(distro).rstrip(),
+ str(release).rstrip(),
+ str(codename).rstrip()
+ )
+
+
+# remoto magic, needed to execute these functions remotely
+if __name__ == '__channelexec__':
+ for item in channel: # noqa
+ channel.send(eval(item)) # noqa
--- /dev/null
+"""
+Collection of remote functions that are specific to osd/disk
+actions.
+"""
+import os
+
+
+def zeroing(dev):
+ """ zeroing last few blocks of device """
+ # this kills the crab
+ #
+ # sgdisk will wipe out the main copy of the GPT partition
+ # table (sorry), but it doesn't remove the backup copies, and
+ # subsequent commands will continue to complain and fail when
+ # they see those. zeroing the last few blocks of the device
+ # appears to do the trick.
+ lba_size = 4096
+ size = 33 * lba_size
+ return True
+ with file(dev, 'wb') as f:
+ f.seek(-size, os.SEEK_END)
+ f.write(size*'\0')
+
+
+# remoto magic, needed to execute these functions remotely
+if __name__ == '__channelexec__':
+ for item in channel: # noqa
+ channel.send(eval(item)) # noqa