'RHEL6_NetworkData' object has no attribute 'activate'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I wrote a simple script to try to use pykickstart:

#!/usr/bin/python

from pykickstart.parser import *
from pykickstart.version import makeVersion

text=True
source='http://test.123.com/abc/123'

ksp = KickstartParser(makeVersion('RHEL6'))
h = ksp.handler
# test or graphical?
if text:
    h.displaymode.displayMode = DISPLAY_MODE_TEXT
# source
if source[:6] == 'nfs://':
    server, dir = source[6:].split('/', 1)
    dir = '/' + dir
    h.method(method='nfs', server=server, dir=dir)
elif source[:6] == 'ftp://' or source[:7] == 'http://':
    h.method(method='url', url=source)
else:
    print 'Error!'
# lang keyboard rootpw
h.lang(lang='en_US.UTF-8')
h.keyboard(keyboard='us')
h.rootpw(isCrypted=False,password='test')
# network
eth = h.NetworkData(device='eth0', bootproto='static', ip='210.179.60.212',
            netmask='255.255.252.0',hostname='ca-ostest212.us.oracle.com',
            onboot='yes')
h.network.dataList().append(eth)
# bootloader
h.bootloader.location='mbr'
# firewall & selinux
h.firewall.enabled = False
h.selinux(selinux=SELINUX_DISABLED)
# reboot
h.reboot(action=KS_REBOOT)
# packages
h.packages.packageList.append('*')
#print dir(h.bootloader)

outfile = open("out.cfg", 'w')
outfile.write(h.__str__())
outfile.close()

When I run this script, I get:

Traceback (most recent call last):
  File "./kstest.py", line 44, in <module>
    outfile.write(h.__str__())
  File "/home/simon/oltest/pykickstart/base.py", line 284, in __str__
    retval += obj.__str__()
  File "/home/simon/oltest/pykickstart/commands/network.py", line 204,
in __str__
    retval += nic.__str__()
  File "/home/simon/oltest/pykickstart/commands/network.py", line 89, in __str__
    retval += "network %s\n" % self._getArgsAsStr()
  File "/home/simon/oltest/pykickstart/commands/network.py", line 180,
in _getArgsAsStr
    if self.activate:
AttributeError: 'RHEL6_NetworkData' object has no attribute 'activate'


Any idea?


Thanks,
rmu

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list


[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux