Giter Site home page Giter Site logo

consentfactory / ztpgenerator Goto Github PK

View Code? Open in Web Editor NEW
35.0 8.0 9.0 55 KB

Python tool simplifying the ZTP process for network device provisioning

License: GNU General Public License v2.0

Python 100.00%
ztp juniper networking-in-python network

ztpgenerator's Issues

`dhcpd_restart_command` subprocess results in errors

When I run ztpgenerator.py device_data.csv, it is now giving me the following errors:

cp: cannot stat '/etc/dhcp/hosts.conf': No such file or directory
rm: cannot remove '/etc/dhcp/hosts.conf': No such file or directory

Generating device and dhcpd config files...

Job for isc-dhcp-server.service failed.
See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.
Job for isc-dhcp-server.service failed.
See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.
Done generating config files...

Running HTTP Server...
Press "Ctrl+C" in console to close HTTP server.
^C

I do not understand the cp and rm outputs, as the /etc/dhcp/hosts.conf file does exist...

root@junos-ztp:~/ztpgenerator# ls -l /etc/dhcp/hosts.conf
-rw-r--r-- 1 root root 3129 Jan 16 20:16 /etc/dhcp/hosts.conf

Also, as for the restart of the isc-dhcp-server service, journalctl shows the service restart failing with "Start request repeated too quickly":

root@junos-ztp:~/ztpgenerator# journalctl -xe -u isc-dhcp-server
-- Unit isc-dhcp-server.service has finished shutting down.
Jan 16 20:16:04 junos-ztp systemd[1]: isc-dhcp-server.service: Start request repeated too quickly.
Jan 16 20:16:04 junos-ztp systemd[1]: isc-dhcp-server.service: Failed with result 'start-limit-hit'.
Jan 16 20:16:04 junos-ztp systemd[1]: Failed to start ISC DHCP IPv4 server.
-- Subject: Unit isc-dhcp-server.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit isc-dhcp-server.service has failed.
--
-- The result is RESULT.

However, if I start the service by hand (systemctl start isc-dhcp-service) it starts correctly and then is running.

Ever see anything like this?

Remove extra "}" char in .format replacement field

with open("{}}dhcpd/dhcpd.j2".format(templates_path)) as t2_fh:

Currently throws traceback:

Traceback (most recent call last):
  File "./ztpgenerator.py", line 214, in <module>
    ztpgenerator(csv_file)
  File "./ztpgenerator.py", line 177, in ztpgenerator
    with open("{}}dhcpd/dhcpd.j2".format(templates_path)) as t2_fh:
ValueError: Single '}' encountered in format string

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.