Set the status of the currently running scan (if any). Args: status (str): scan status started (float): timestamp at start of scan ended (float): timestamp at end of scan Raises: TypeError: arg type was invalid ValueError:
(self, status, started=None, ended=None)
| 226 | return self.__status |
| 227 | |
| 228 | def __setStatus(self, status, started=None, ended=None): |
| 229 | """Set the status of the currently running scan (if any). |
| 230 | |
| 231 | Args: |
| 232 | status (str): scan status |
| 233 | started (float): timestamp at start of scan |
| 234 | ended (float): timestamp at end of scan |
| 235 | |
| 236 | Raises: |
| 237 | TypeError: arg type was invalid |
| 238 | ValueError: arg value was invalid |
| 239 | """ |
| 240 | if not isinstance(status, str): |
| 241 | raise TypeError(f"status is {type(status)}; expected str()") |
| 242 | |
| 243 | if status not in [ |
| 244 | "INITIALIZING", |
| 245 | "STARTING", |
| 246 | "STARTED", |
| 247 | "RUNNING", |
| 248 | "ABORT-REQUESTED", |
| 249 | "ABORTED", |
| 250 | "ABORTING", |
| 251 | "FINISHED", |
| 252 | "ERROR-FAILED" |
| 253 | ]: |
| 254 | raise ValueError(f"Invalid scan status {status}") |
| 255 | |
| 256 | self.__status = status |
| 257 | self.__dbh.scanInstanceSet(self.__scanId, started, ended, status) |
| 258 | |
| 259 | def __startScan(self): |
| 260 | """Start running a scan. |
no test coverage detected