Univention Bugzilla – Attachment 10134 Details for
Bug 49913
Subnet range is legacy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Convert legacy dhcp ranges to pools
49913_udm-dhcp-pool-convert.py (text/plain), 575 bytes, created by
Philipp Hahn
on 2019-07-25 09:37 CEST
(
hide
)
Description:
Convert legacy dhcp ranges to pools
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2019-07-25 09:37 CEST
Size:
575 bytes
patch
obsolete
>#!/usr/bin/python2 >from __future__ import print_function >from itertools import chain >from univention.udm import UDM > >udm = UDM.admin().version(1) >m_subnet = udm.get('dhcp/subnet') >m_shared = udm.get('dhcp/sharedsubnet') >m_pool = udm.get('dhcp/pool') > >for obj in chain(*[m.search('dhcpRange=*') for m in (m_subnet, m_shared)]): > print(obj) > pool = m_pool.new(superordinate=obj) > pool.superordinate = obj # Bug #49919 > pool.props.name = 'auto-converted' > pool.props.range = list(obj.props.range) > del obj.props.range[:] > pool.save() # BUG > obj.save()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 49913
: 10134