def setupZTP(self): ''' Setup Zero Touch Provisioning Generate DHCP config file Install and restart DHCP server with new dhcp configuration ''' ztpServer = ZtpServer() ztpServer.createPodSpecificDhcpConfFile('anotherPod') if jnpr.openclos.util.isPlatformUbuntu(): os.system('sudo apt-get -y install isc-dhcp-server') os.system('sudo cp ' + generatedDhcpConf + ' ' + installedDhcpConf) os.system("/etc/init.d/isc-dhcp-server restart") elif jnpr.openclos.util.isPlatformCentos(): os.system('yum -y install dhcp') os.system('sudo cp ' + generatedDhcpConf + ' ' + installedDhcpConf) os.system("/etc/rc.d/init.d/dhcpd restart")
def setupZTP(self): ''' Setup Zero Touch Provisioning Generate DHCP config file Install and restart DHCP server with new dhcp configuration ''' ztpServer = ZtpServer() ztpServer.createPodSpecificDhcpConfFile('anotherPod') if jnpr.openclos.util.isPlatformUbuntu(): os.system('sudo apt-get -y install isc-dhcp-server') os.system('sudo cp ' + generatedDhcpConf + ' ' + installedDhcpConf) os.system("/etc/init.d/isc-dhcp-server restart") elif jnpr.openclos.util.isPlatformCentos(): os.system('yum -y install dhcp') os.system('sudo cp ' + generatedDhcpConf + ' ' + installedDhcpConf) os.system("/etc/rc.d/init.d/dhcpd restart")
def setupZTP(self): ''' Setup Zero Touch Provisioning Generate DHCP config file Install and restart DHCP server with new dhcp configuration ''' ztpServer = ZtpServer() with ztpServer._dao.getReadSession() as session: ztpServer.createPodSpecificDhcpConfFile(session, self.pod.id) print generatedDhcpConf if jnpr.openclos.util.isPlatformUbuntu(): os.system('sudo apt-get -y install isc-dhcp-server') os.system('sudo cp ' + generatedDhcpConf + ' ' + installedDhcpConf) os.system('sudo /usr/sbin/service isc-dhcp-server restart') elif jnpr.openclos.util.isPlatformCentos(): os.system('yum -y install dhcp') os.system('sudo cp ' + generatedDhcpConf + ' ' + installedDhcpConf) os.system("/etc/rc.d/init.d/dhcpd restart")
def setupZTP(self): ''' Setup Zero Touch Provisioning Generate DHCP config file Install and restart DHCP server with new dhcp configuration ''' ztpServer = ZtpServer() with ztpServer._dao.getReadSession() as session: ztpServer.createPodSpecificDhcpConfFile(session, self.pod.id) print generatedDhcpConf if jnpr.openclos.util.isPlatformUbuntu(): os.system('sudo apt-get -y install isc-dhcp-server') os.system('sudo cp ' + generatedDhcpConf + ' ' + installedDhcpConf) os.system('sudo /usr/sbin/service isc-dhcp-server restart') elif jnpr.openclos.util.isPlatformCentos(): os.system('yum -y install dhcp') os.system('sudo cp ' + generatedDhcpConf + ' ' + installedDhcpConf) os.system("/etc/rc.d/init.d/dhcpd restart")