Skip to content

Commit ab7da1d

Browse files
Ambient Code Botclaude
andcommitted
nanokvm: address review feedback and remove dead serial/SSH code
- Extract NanoKVMDriverBase to deduplicate client management across NanoKVMVideo and NanoKVMHID (~30 lines of copy-paste removed) - Remove NanoKVMSerial placeholder class and all SSH/serial config (enable_serial, ssh_username, ssh_password, ssh_port) - Fix stream re-auth bug: keep send_stream context open during retry so the retry can still write to the stream - Replace asyncio.create_task with anyio.create_task_group for consistency with project conventions - Apply @with_reauth decorator directly on NanoKVM composite methods instead of fragile inner-function pattern; delegate _get_client and _reset_client to video child driver - Fix mount_image unmount logic: pass None explicitly for unmount instead of confusing `mount_file or None` expression - Add pytest-asyncio to dev dependencies (needed for asyncio_mode=auto) - Remove jumpstarter-driver-pyserial dependency (only needed for serial) - Add get_images to API docs :members: list - Remove serial/SSH references from README and documentation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 97f2db1 commit ab7da1d

6 files changed

Lines changed: 104 additions & 277 deletions

File tree

python/packages/jumpstarter-driver-nanokvm/README.md

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,50 +41,28 @@ export:
4141
password: "admin" # Default NanoKVM web interface password
4242
```
4343
44-
### Advanced Configuration
45-
46-
```yaml
47-
export:
48-
nanokvm:
49-
type: jumpstarter_driver_nanokvm.driver.NanoKVM
50-
config:
51-
host: "192.168.1.100"
52-
username: "admin"
53-
password: "your-password"
54-
# Optional: SSH access for serial console (future feature)
55-
enable_serial: false
56-
ssh_username: "root"
57-
ssh_password: "root"
58-
ssh_port: 22
59-
```
60-
6144
### Config Parameters
6245
6346
| Parameter | Description | Type | Required | Default |
6447
| -------------- | ------------------------------------------ | ----- | -------- | ------- |
6548
| host | NanoKVM hostname or IP address | str | yes | |
6649
| username | Web interface username | str | no | "admin" |
6750
| password | Web interface password | str | no | "admin" |
68-
| enable_serial | Enable serial console access via SSH | bool | no | false |
69-
| ssh_username | SSH username for serial console | str | no | "root" |
70-
| ssh_password | SSH password for serial console | str | no | "root" |
71-
| ssh_port | SSH port for serial console | int | no | 22 |
7251
7352
## Architecture
7453
75-
The NanoKVM driver is a composite driver that provides three main interfaces:
54+
The NanoKVM driver is a composite driver that provides two main interfaces:
7655
7756
1. **video**: Video streaming and snapshot capture
7857
2. **hid**: Keyboard and mouse HID control
79-
3. **serial**: Serial console access (optional, future feature)
8058
8159
## API Reference
8260
8361
### NanoKVMClient
8462
8563
```{eval-rst}
8664
.. autoclass:: jumpstarter_driver_nanokvm.client.NanoKVMClient()
87-
:members: get_info, reboot, mount_image, download_image, get_mounted_image, get_cdrom_status, is_image_download_enabled, get_image_download_status
65+
:members: get_info, reboot, mount_image, download_image, get_mounted_image, get_cdrom_status, is_image_download_enabled, get_image_download_status, get_images
8866
```
8967
9068
### NanoKVMVideoClient

python/packages/jumpstarter-driver-nanokvm/examples/exporter.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,3 @@ export:
1212
host: "192.168.1.110" # or IP address like "192.168.1.100"
1313
username: "admin"
1414
password: "admin"
15-
# Optional: Enable serial console access via SSH
16-
# enable_serial: true
17-
# ssh_username: "root"
18-
# ssh_password: "root"
19-
# ssh_port: 22

python/packages/jumpstarter-driver-nanokvm/jumpstarter_driver_nanokvm/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
This package provides support for NanoKVM devices, including:
44
- Video streaming and snapshot capture
55
- Keyboard and mouse HID control
6-
- Serial console access (optional)
76
"""
87

98
from .driver import NanoKVM, NanoKVMHID, NanoKVMVideo
109

1110
__all__ = ["NanoKVM", "NanoKVMVideo", "NanoKVMHID"]
12-
13-

python/packages/jumpstarter-driver-nanokvm/jumpstarter_driver_nanokvm/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ class NanoKVMClient(CompositeClient):
269269
This composite client provides access to all NanoKVM functionality:
270270
- video: Video streaming and snapshots
271271
- hid: Keyboard and mouse control
272-
- serial: Serial console access (if enabled)
273272
274273
Example::
275274

0 commit comments

Comments
 (0)