Example #1
0
 def nspawn_exec_stop(self) -> Command:
     """
     Container stop command
     """
     program = system_command('true')
     return Command([program])
Example #2
0
 def file_create(self, path) -> Command:
     touch = system_command('touch')
     return Command([touch, '-a', path])
Example #3
0
 def nspawn_exec_start(self) -> Command:
     """
     Container start command
     """
     program = SYSTEMD_NSPAWN.binary
     return Command([program])
Example #4
0
 def folder_create(self, path) -> Command:
     mkdir = system_command('mkdir')
     return Command([mkdir, '-p', path])
Example #5
0
 def folder_delete(self, path) -> Command:
     rm = system_command('rm')
     return Command([rm, '-r', '-f', path])
Example #6
0
 def mount_point_desure(self) -> Command:  # TODO
     shell = system_command('sh')
     test = " ".join(self.mount_point_test())
     delete = " ".join(self.mount_point_delete())
     return Command([shell, '-c', f"while {test} ; do {delete} ; sleep {self.delay} ; done" ])
Example #7
0
 def mount_point_ensure(self) -> Command:  # TODO
     shell = system_command('sh')
     test = " ".join(self.mount_point_test())
     create = " ".join(self.mount_point_create())
     return Command([shell, '-c', f"until {test} ; do {create} ; sleep {self.delay} ; done" ])
Example #8
0
 def mount_point_delete(self) -> Command:
     umount = system_command('umount')
     point = self.machine_store.mount_point()
     return Command([umount, point])
Example #9
0
 def mount_point_create(self) -> Command:
     mount = system_command('mount')
     point = self.machine_store.mount_point()
     options = self.mount_options()
     return Command([mount, '-t', 'overlay', '-o', options, 'overlay', point])
Example #10
0
 def mount_point_test(self) -> Command:
     test = system_command('mountpoint')
     point = self.machine_store.mount_point()
     return Command([test, point])