mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-11-04 00:52:08 +00:00 
			
		
		
		
	commands/revent: Fix revent command
Update revent commands to supply output directory when creating TargetManager and fix ignoring any additional device config provided.
This commit is contained in:
		@@ -96,6 +96,7 @@ class RecordCommand(Command):
 | 
			
		||||
 | 
			
		||||
    def execute(self, state, args):
 | 
			
		||||
        self.validate_args(args)
 | 
			
		||||
        state.run_config.merge_device_config(state.plugin_cache)
 | 
			
		||||
        if args.device:
 | 
			
		||||
            device = args.device
 | 
			
		||||
            device_config = {}
 | 
			
		||||
@@ -103,7 +104,12 @@ class RecordCommand(Command):
 | 
			
		||||
            device = state.run_config.device
 | 
			
		||||
            device_config = state.run_config.device_config or {}
 | 
			
		||||
 | 
			
		||||
        self.tm = TargetManager(device, device_config)
 | 
			
		||||
        if args.output:
 | 
			
		||||
            outdir = os.path.basename(args.output)
 | 
			
		||||
        else:
 | 
			
		||||
            outdir = os.getcwd()
 | 
			
		||||
 | 
			
		||||
        self.tm = TargetManager(device, device_config, outdir)
 | 
			
		||||
        self.target = self.tm.target
 | 
			
		||||
        self.revent_recorder = ReventRecorder(self.target)
 | 
			
		||||
        self.revent_recorder.deploy()
 | 
			
		||||
@@ -228,6 +234,7 @@ class ReplayCommand(Command):
 | 
			
		||||
 | 
			
		||||
    # pylint: disable=W0201
 | 
			
		||||
    def execute(self, state, args):
 | 
			
		||||
        state.run_config.merge_device_config(state.plugin_cache)
 | 
			
		||||
        if args.device:
 | 
			
		||||
            device = args.device
 | 
			
		||||
            device_config = {}
 | 
			
		||||
@@ -235,13 +242,13 @@ class ReplayCommand(Command):
 | 
			
		||||
            device = state.run_config.device
 | 
			
		||||
            device_config = state.run_config.device_config or {}
 | 
			
		||||
 | 
			
		||||
        target_manager = TargetManager(device, device_config)
 | 
			
		||||
        target_manager = TargetManager(device, device_config, None)
 | 
			
		||||
        self.target = target_manager.target
 | 
			
		||||
        revent_file = self.target.path.join(self.target.working_directory,
 | 
			
		||||
                                            os.path.split(args.revent)[1])
 | 
			
		||||
                                            os.path.split(args.recording)[1])
 | 
			
		||||
 | 
			
		||||
        self.logger.info("Pushing file to target")
 | 
			
		||||
        self.target.push(args.revent, self.target.working_directory)
 | 
			
		||||
        self.target.push(args.recording, self.target.working_directory)
 | 
			
		||||
 | 
			
		||||
        revent_recorder = ReventRecorder(target_manager.target)
 | 
			
		||||
        revent_recorder.deploy()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user