Skip to content

example script ignores address options when using --connection=client #149

@nirs

Description

@nirs

Description

When using --connection=client, the example script's client_command() method in vmnet/vm.py does not pass --start-address, --end-address, and --subnet-mask options to vmnet-client.

Current behavior

The address options are silently ignored:

def client_command(self, vm_command):
    cmd = [self.client]
    if self.args.operation_mode:
        cmd.append(f"--operation-mode={self.args.operation_mode}")
    if self.args.operation_mode == "bridged":
        cmd.append(f"--shared-interface={self.args.shared_interface}")
    elif self.args.operation_mode == "host" and self.args.enable_isolation:
        cmd.append("--enable-isolation")
    # Missing: start_address, end_address, subnet_mask

Expected behavior

The address options should be passed to vmnet-client when using shared mode:

if self.args.operation_mode == "shared" or self.args.operation_mode is None:
    if self.args.start_address:
        cmd.append(f"--start-address={self.args.start_address}")
    if self.args.end_address:
        cmd.append(f"--end-address={self.args.end_address}")
    if self.args.subnet_mask:
        cmd.append(f"--subnet-mask={self.args.subnet_mask}")

Note

This is similar to how vmnet/helper.py handles these options in _build_command().

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions