driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 15s
driver / test (3.12) (pull_request) Failing after 14s
driver / types (pull_request) Failing after 23s
driver / test (3.13) (pull_request) Failing after 13s
driver / lowest (pull_request) Failing after 14s
driver / security (pull_request) Failing after 32s
driver / build (pull_request) Successful in 25s
CI / driver (pull_request) Failing after 1m21s
driver / publish (pull_request) Skipped
netOrk shows and controls every scheduled job of a host; on Windows that is the Task Scheduler. The driver now implements napalm-device-types' ScheduledJobsMixin over PowerShell Remoting, one script per call as every getter does. get_scheduled_jobs reads every task with its run info in one script (Get-ScheduledTask, Get-ScheduledTaskInfo) as task:<path><name>, its triggers summarised. Tasks under \Microsoft\ are the platform's, others the admin's: Windows does not record which software installed a task. The time zone is mapped to IANA for the common Windows zones, else None. A reading cut short, or holding fewer tasks than it counted, raises. manage_scheduled_job switches the task's own flag or starts it; Start-ScheduledTask returns once the task has started, so the result says that and no more. A disabled task, or one that refuses a start on demand, is not offered run. put_scheduled_job registers an application's task \<name> in the root folder from XML, so a create and a change write the whole definition the same way: the command runs in cmd.exe /d /s /c, the principal is SYSTEM or a local user without a stored password (S4U), and the cron expression becomes triggers only where Task Scheduler can say it exactly; any other shape is refused, naming why. The description keeps the job's name and cron expression, so the reading gives back what was written, and the digest also covers the triggers, so a change by hand is seen. delete_scheduled_job unregisters such a task and no other. Every write reads the task again first, and every value goes into PowerShell single-quoted with its quotes doubled. Requires napalm-device-types 4.26.0. Closes #8
95 lines
2.2 KiB
TOML
95 lines
2.2 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=77"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "napalm-windows"
|
|
version = "0.2.0"
|
|
description = "NAPALM driver for Windows hosts via PowerShell Remoting (WinRM)"
|
|
readme = "README.md"
|
|
requires-python = ">=3.12"
|
|
license = "Apache-2.0"
|
|
authors = [
|
|
{ name = "Christian Manivong", email = "christian@manivong.de" },
|
|
]
|
|
keywords = [
|
|
"napalm",
|
|
"network",
|
|
"automation",
|
|
"windows",
|
|
"winrm",
|
|
"powershell",
|
|
"psrp",
|
|
"driver",
|
|
]
|
|
classifiers = [
|
|
"Development Status :: 3 - Alpha",
|
|
"Intended Audience :: Developers",
|
|
"Intended Audience :: System Administrators",
|
|
"Operating System :: OS Independent",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
"Topic :: System :: Networking",
|
|
"Topic :: System :: Systems Administration",
|
|
"Typing :: Typed",
|
|
]
|
|
dependencies = [
|
|
"napalm>=5.1", # older releases import pkg_resources, which a 3.12 venv lacks
|
|
"napalm-device-types>=4.26.0", # ScheduledJobsMixin
|
|
"pypsrp>=0.8",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=8",
|
|
"pytest-cov>=5",
|
|
"mypy>=1.11",
|
|
"ruff>=0.6",
|
|
]
|
|
|
|
[project.entry-points."napalm.drivers"]
|
|
windows = "napalm_windows:WindowsDriver"
|
|
|
|
[project.urls]
|
|
Repository = "https://git.netork.io/NAPALM/napalm-windows"
|
|
Issues = "https://git.netork.io/NAPALM/napalm-windows/issues"
|
|
Changelog = "https://git.netork.io/NAPALM/napalm-windows/src/branch/main/CHANGELOG.md"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["."]
|
|
include = ["napalm_windows*"]
|
|
|
|
[tool.setuptools.package-data]
|
|
napalm_windows = ["py.typed"]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py312"
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "UP", "B"]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
# Recorded device output keeps its lines.
|
|
"tests/**" = ["E501"]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.12"
|
|
strict = true
|
|
# napalm itself is untyped, so every driver subclasses Any.
|
|
disallow_subclassing_any = false
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = ["napalm.*", "pypsrp.*"]
|
|
ignore_missing_imports = true
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
|
|
[tool.coverage.run]
|
|
source = ["napalm_windows"]
|
|
|
|
[tool.coverage.report]
|
|
fail_under = 95
|