Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Unable to create pxe record without password #3

Open
bastelfreak opened this issue Oct 26, 2015 · 1 comment
Open

Unable to create pxe record without password #3

bastelfreak opened this issue Oct 26, 2015 · 1 comment

Comments

@bastelfreak
Copy link
Contributor

My default label doesn't need a password so it doesn't have a callback method defined:

[Modules]
PXE: True
VM: False

[Webserver]
Username: admin
Password: secret
BasicRealm: marmoset
Host: 10.30.7.40
Port: 8080
ServerName: dhcp01.aweso.me
Debug: True

[Libvirt]
URI: qemu:///system
XMLTemplateDirectory: 
Network:
Storage: 

[PXEConfig]
ConfigDirectory: /srv/tftp/pxelinux.cfg/

[PXELabel]
arch-hdd-net:
rescue: setpwhash

If fails to create a PXE entry if I start marmoset without a password:

root@dhcp01 /opt/marmoset # ./marmoset.py pxe create 10.30.7.41
Traceback (most recent call last):
  File "./marmoset.py", line 6, in <module>
    marmoset.run()
  File "/opt/marmoset/marmoset/__init__.py", line 5, in run
    cli.parse(cfg)
  File "/opt/marmoset/marmoset/cli/__init__.py", line 47, in parse
    args.func(args)
  File "/opt/marmoset/marmoset/pxe/__init__.py", line 9, in create
    print(msg % (pxe_client.file_path(), pxe_client.password))
AttributeError: 'ClientConfig' object has no attribute 'password'
root@dhcp01 /opt/marmoset # ./marmoset.py pxe create -p 123 10.30.7.41
Created /srv/tftp/pxelinux.cfg/0A1E0729 with password 123
root@dhcp01 /opt/marmoset # cat /srv/tftp/pxelinux.cfg/0A1E0729
INCLUDE pxelinux.cfg/default
DEFAULT instantboot
PROMPT 0
TIMEOUT 1
LABEL instantboot
    KERNEL cmd.c32
    APPEND arch-hdd-net 
root@dhcp01 /opt/marmoset #
@aibor
Copy link
Owner

aibor commented Oct 26, 2015

https://github.com/aibor/marmoset/blob/master/marmoset/pxe/__init__.py#L9 is missing a check if a password is set before trying to access the attribute. Not my use case, so PR welcome.

@aibor aibor closed this as completed Oct 26, 2015
@aibor aibor reopened this Oct 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants