Get the contents of ``_updates`` (all updates) and puts them in an Updates class to expose the list and summary functions. Returns: Updates: An instance of the Updates class with all updates for the system. Code Example:
(self)
| 331 | self.refresh(online=online) |
| 332 | |
| 333 | def updates(self): |
| 334 | """ |
| 335 | Get the contents of ``_updates`` (all updates) and puts them in an |
| 336 | Updates class to expose the list and summary functions. |
| 337 | |
| 338 | Returns: |
| 339 | |
| 340 | Updates: |
| 341 | An instance of the Updates class with all updates for the |
| 342 | system. |
| 343 | |
| 344 | Code Example: |
| 345 | |
| 346 | .. code-block:: python |
| 347 | |
| 348 | import salt.utils.win_update |
| 349 | wua = salt.utils.win_update.WindowsUpdateAgent() |
| 350 | updates = wua.updates() |
| 351 | |
| 352 | # To get a list |
| 353 | updates.list() |
| 354 | |
| 355 | # To get a summary |
| 356 | updates.summary() |
| 357 | """ |
| 358 | updates = Updates() |
| 359 | found = updates.updates |
| 360 | |
| 361 | for update in self._updates: |
| 362 | found.Add(update) |
| 363 | |
| 364 | return updates |
| 365 | |
| 366 | def refresh(self, online=True): |
| 367 | """ |