def push_assets(self, context): for f in self.deployable_assets: fpath = context.resolver.get(File(self, f)) device_path = self._path_on_device(fpath) if self.force_push_assets or not self.device.file_exists( device_path): self.device.push_file(fpath, device_path, timeout=300)
def push_assets(self, context): for f in self.deployable_assets: fpath = context.resolver.get(File(self, f)) device_path = self._path_on_device(fpath) if self.force_push_assets or not self.device.file_exists(device_path): self.device.push_file(fpath, device_path, timeout=300) self.device.broadcast_media_mounted(self.device.working_directory)
def _check_statedetection_files(self, context): try: self.statedefs_dir = context.resolver.get( File(self, 'state_definitions')) except ResourceError: self.logger.warning( "State definitions directory not found. Disabling state detection." ) self.check_states = False # pylint: disable=W0201
def push_assets(self, context): pushed = False file_list = [] for f in self.deployable_assets: fpath = context.resolver.get(File(self, f)) device_path = self._path_on_device(fpath) if self.force_push_assets or not self.device.file_exists(device_path): self.device.push_file(fpath, device_path, timeout=300) file_list.append(device_path) pushed = True if pushed: self.device.refresh_device_files(file_list)
def initialize(self, context): # pylint: disable=no-self-use assets_dir = self.device.path.join(self.device.working_directory, 'assets') self.device.execute('mkdir -p {}'.format(assets_dir)) assets_tar = 'octaned8-assets.tar' fpath = context.resolver.get(File(self, assets_tar)) self.device.push_file(fpath, assets_dir, timeout=300) self.command = 'cd {}; {} busybox tar -x -f {}'.format(assets_dir, self.device.busybox, assets_tar) self.output = self.device.execute(self.command, timeout=self.run_timeout) for f in self.executables: binFile = context.resolver.get(Executable(self, self.device.abi, f)) self.device_exe = self.device.install(binFile)