rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
help="Loop until no changes found")
help="loop until no changes found")
def arguments(): """Defines the command line arguments for the script.""" main_desc = ("Mirror a remote FTP directory into a local directory or vice " "versa through the lftp program") subs_desc = "Select a running mode from the following:" epilog = ("For detailed help for each mode, select a mode followed by help " "option, e.g.:{0}{0}%(prog)s shell -h").format(os.linesep) cron_use = "%(prog)s [-h]" shell_use = ("%(prog)s site remote local [options]{0}{0}By default " "downloads the changes from remote FTP directory to local " "directory.{0}To upload changes from local to remote FTP, use " "the 'r, --reverse' option").format(os.linesep) file_use = ("%(prog)s config_file [-h]{0}{0}The structure of the " "config file (a simple text file) is as follows:{0}{0}[section]" "{0}site = {{ftp server URL or IP}}{0}port = (ftp server port)" "{0}remote = {{remote directory}}{0}local = {{local directory}}" "{0}user = (ftp server username){0}password = (user password " "encoded in base64){0}options = (other options){0}{0}Section is" " a name that defines the mirror operation. Usually is the ftp " "server's name or directory' name. Useful for distinguish one " "mirror operation from others. Write one section for each " "mirror action with no limits in the number of sections.{0}{0}" "Values between curly brackets '{{}}' are required arguments " "and values between brackets '()' are optional arguments. If " "don't want optional arguments, left them blank. In case you do" " not specify a username and password, you must add the '-a' " "option which specifies that the connection is made with the " "anonymous user.{0}{0}The order of arguments doesn't matter, " "but all are needed.{0}{0}").format(os.linesep) parser = ArgumentParser(description=main_desc, epilog=epilog) subparsers = parser.add_subparsers(title="running modes", description=subs_desc) cron = subparsers.add_parser("cron", help="ideal to run as a scheduled task" ". Takes arguments from parameters defined " "within the script", usage=cron_use) cron.add_argument("cron", action="store_true", help=SUPPRESS, default=SUPPRESS) cron.add_argument("cfg", action="store_false", help=SUPPRESS, default=SUPPRESS) cfg = subparsers.add_parser("cfg", help="ideal for mirror multiple sites/" "directories. Imports the arguments from a " "config file", usage=file_use) cfg.add_argument("cron", action="store_false", help=SUPPRESS, default=SUPPRESS) cfg.add_argument("cfg", action="store_true", help=SUPPRESS, default=SUPPRESS) cfg.add_argument("config_file", help="config file to import arguments") shell = subparsers.add_parser("shell", help="usual mode, takes arguments " "from the command line ", usage=shell_use) shell.add_argument("cron", action="store_false", help=SUPPRESS, default=SUPPRESS) shell.add_argument("cfg", action="store_false", help=SUPPRESS, default=SUPPRESS) shell.add_argument("site", help="the ftp server (URL or IP)") shell.add_argument("remote", help="the remote directory") shell.add_argument("local", help="the local directory") auth = shell.add_mutually_exclusive_group(required=True) auth.add_argument("-l", "--login", dest="login", nargs=2, help="the ftp account's username and password", metavar=("user", "password")) auth.add_argument("-a", "--anon", action="store_true", dest="anonymous", help="set user as anonymous", default=False) shell.add_argument("-p", "--port", dest="port", default="", help="the ftp server port", metavar="port") shell.add_argument("-s", "--secure", action="store_const", const="s", dest="secure", default="", help="use the sftp protocol instead of ftp") shell.add_argument("-e", "--erase", action="store_const", const="e", dest="erase", default="", help="delete files not present at target site") shell.add_argument("-n", "--newer", action="store_const", const="n", dest="newer", default="", help="download only newer files") shell.add_argument("-P", "--parallel", action="store_const", const="P", dest="parallel", default="", help="download files in parallel") shell.add_argument("-r", "--reverse", action="store_const", const="R", dest="reverse", default="", help="reverse, upload files from local to remote") shell.add_argument("--delete-first", action="store_const", const=" --delete-first", dest="del_first", default="", help="delete old files before transferring new ones") shell.add_argument("--depth-first", action="store_const", const=" --depth-first", dest="depth_first", default="", help="descend into subdirectories, before transfer files") shell.add_argument("--no-empty-dirs", action="store_const", const=" --no-empty-dirs", dest="no_empty_dir", default="", help="don't create empty dirs (needs --depth-first)") shell.add_argument("--no-recursion", action="store_const", const=" --no-recursion", dest="no_recursion", default="", help="don't go to subdirectories") shell.add_argument("--dry-run", action="store_const", const=" --dry-run", dest="dry_run", default="", help="simulation, don't execute anything. Writes to log") shell.add_argument("--use-cache", action="store_const", const=" --use-cache", dest="use_cache", default="", help="use cached directory listings") shell.add_argument("--del-source", action="store_const", const=" --Remove-source-files", dest="del_source", default="", help="remove files (no dirs) after transfer (Caution!)") shell.add_argument("--only-missing", action="store_const", const=" --only-missing", dest="missing", default="", help="download only missing files") shell.add_argument("--only-existing", action="store_const", const=" --only-existing", dest="existing", default="", help="download only files already existing at target") shell.add_argument("--loop", action="store_const", const=" --loop", dest="loop", default="", help="Loop until no changes found") shell.add_argument("--ignore-size", action="store_const", const=" --ignore-size", dest="size", default="", help="ignore size when deciding whether to download") shell.add_argument("--ignore-time", action="store_const", const=" --ignore-time", dest="time", default="", help="ignore time when deciding whether to download") shell.add_argument("--no-perms", action="store_const", const=" --no-perms", dest="no_perms", default="", help="don't set file permissions") shell.add_argument("--no-umask", action="store_const", const=" --no-umask", dest="no_umask", default="", help="don't apply umask to file modes") shell.add_argument("--no-symlinks", action="store_const", const=" --no-symlinks", dest="no_symlinks", default="", help="don't create symbolic links") shell.add_argument("--allow-suid", action="store_const", const=" --allow-suid", dest="suid", default="", help="set suid/sgid bits according to remote site") shell.add_argument("--allow-chown", action="store_const", const=" --allow-chown", dest="chown", default="", help="try to set owner and group on files") shell.add_argument("--dereference", action="store_const", const=" --dereference", dest="dereference", default="", help="download symbolic links as files") shell.add_argument("--exclude-glob", dest="exc_glob", default="", metavar="GP", help="exclude matching files. GP is a glob pattern, e.g." " '*.zip'") shell.add_argument("--include-glob", dest="inc_glob", default="", metavar="GP", help="include matching files. GP is a glob pattern, e.g." " '*.zip'") shell.add_argument("-q", "--quiet", action="store_true", dest="quiet", help="the detailed shell process is no " "displayed, but is added to the log", default=False) shell.add_argument("--no-compress", action="store_true", dest="no_compress", help="don't create daily archive " "files", default=False) shell.add_argument("--no-email", action="store_true", dest="no_email", help="no sends email with the log", default=False) shell.add_argument("--smtp_server", dest="smtp_server", default="localhost", metavar="server", help="set a smtp server") shell.add_argument("--smtp_user", dest="smtp_user", default="", metavar="user", help="the smtp server username") shell.add_argument("--smtp_pass", dest="smtp_pass", default="", metavar="password", help="the smtp server password") shell.add_argument("--from_addr", dest="from_addr", default="", metavar="email", help="sender's email address") shell.add_argument("--to_addrs", dest="to_addrs", default="", nargs='+', metavar="email", help="a list of receiver(s)' email address(es)") parser.add_argument("-v", "--version", action="version", version="%(prog)s {0}".format(__version__), help="show program's version number and exit") return parser
msg = _(u'Invalid time') + u' (0:00-23:59): ' + unicode(time)
msg = _(u'Invalid time (0:00-23:59): ${time}', mapping=dict(time=unicode(time)))
def edit_entry(self, **kwargs): """ In this call we handle a form which contains one entry. This entry has a text and time field which we expect to change. """ plone = self.getCommandSet("plone") core = self.getCommandSet("core") tracker = get_tracker(self.context) text = self.request.get('text') if not text: message = _(u'msg_empty_text', default=u'Empty text, this is not allowed') plone.issuePortalMessage(message, msgtype="error") return time = self.request.get('time') uid = self.request.get('uid') idx = int(self.request.get('entry_number'))
rounded_time = mx.DateTime.DateTimeDelta( time.day, time.hour, math.ceil(time.minutes))
rounded_time = round_time_to_minutes(time)
def add_entry(tracker, task, text): current_time = mx.DateTime.now() time = current_time - tracker.starttime rounded_time = mx.DateTime.DateTimeDelta( time.day, time.hour, math.ceil(time.minutes)) task.entries.append(Entry(text, rounded_time)) # Reset the timer's start time tracker.starttime = current_time
zopepublication.ZopePublication.handleException = handleException
def handleException(self, object, request, exc_info, retry_allowed=True): orig = removeAllProxies(object) oldHandleException(self, object, request, exc_info, retry_allowed=retry_allowed) if type(orig) is MethodType: notify(AfterCallEvent(orig.im_self, request)) else: notify(AfterCallEvent(orig, request))
self.uid = md5.md5(time.ctime()).hexdigest()
return md5.md5(datetime.datetime.now().isoformat()).hexdigest()
def generate(self): self.uid = md5.md5(time.ctime()).hexdigest()
notify(AfterCallEvent(orig.im_self, request))
notify(AfterExceptionCallEvent(orig.im_self, request))
def handleException(self, object, request, exc_info, retry_allowed=True): orig = removeAllProxies(object) oldHandleException(self, object, request, exc_info, retry_allowed=retry_allowed) if type(orig) is MethodType: notify(AfterCallEvent(orig.im_self, request)) else: notify(AfterCallEvent(orig, request))
notify(AfterCallEvent(orig, request))
notify(AfterExceptionCallEvent(orig, request))
def handleException(self, object, request, exc_info, retry_allowed=True): orig = removeAllProxies(object) oldHandleException(self, object, request, exc_info, retry_allowed=retry_allowed) if type(orig) is MethodType: notify(AfterCallEvent(orig.im_self, request)) else: notify(AfterCallEvent(orig, request))
zopepublication.ZopePublication.handleException = handleException
def handleException(self, object, request, exc_info, retry_allowed=True): orig = removeAllProxies(object) oldHandleException(self, object, request, exc_info, retry_allowed=retry_allowed) if type(orig) is MethodType: notify(AfterCallEvent(orig.im_self, request)) else: notify(AfterCallEvent(orig, request))
return md5.md5(datetime.datetime.now().isoformat()).hexdigest()
self.uid = md5.md5(datetime.datetime.now().isoformat()).hexdigest() return self.uid
def generate(self): return md5.md5(datetime.datetime.now().isoformat()).hexdigest()
def handleException(self, object, request, exc_info, retry_allowed=True): super(BrowserPublication, self).handleException( object, request, exc_info, retry_allowed) orig = removeAllProxies(object) if type(orig) is MethodType: notify(AfterExceptionCallEvent(orig.im_self, request)) else: notify(AfterExceptionCallEvent(orig, request))
def handleException(self, object, request, exc_info, retry_allowed=True): super(BrowserPublication, self).handleException( object, request, exc_info, retry_allowed)
if kickstartable and osname=='linux':
if kickstartable:
def run(self, params, args):
[app_name, 'dhcp_filename','/install/sbin/kickstart.cgi'])
[app_name, 'dhcp_filename','pxelinux.0'])
def run(self, params, args):
rows = self.db.execute("""select id from subnets where name = '%s'""" % network)
if network == 'all': inid = '0' else: rows = self.db.execute("""select id from subnets where name = '%s'""" % network)
def deleteRule(self, table, extrawhere, service, network, outnetwork, chain, action, protocol):
if rows == 0: self.abort('network "%s" not in database' % network)
if rows == 0: self.abort('network "%s" not in ' + 'database' % network)
def deleteRule(self, table, extrawhere, service, network, outnetwork, chain, action, protocol):
rows = self.db.execute("""select id from subnets where name = '%s'""" % outnetwork)
if outnetwork == 'all': outid = '0' else: rows = self.db.execute("""select id from subnets where name = '%s'""" % outnetwork)
def deleteRule(self, table, extrawhere, service, network, outnetwork, chain, action, protocol):
if rows == 0: self.abort('output-network "%s" not in database' % network)
if rows == 0: self.abort('output-network "%s" not ' + 'in database' % network)
def deleteRule(self, table, extrawhere, service, network, outnetwork, chain, action, protocol):
(state, key) = self.fillParams([ ('state', ),
(switch, key) = self.fillParams([ ('switch', ),
def run(self, params, args): (state, key) = self.fillParams([ ('state', ), ('key', ) ]) if not len(args): self.abort('must supply at least one host')
if state not in [ 'on', 'off' ]: self.abort('invalid state. state must be "on" or "off"')
if switch not in [ 'on', 'off' ]: self.abort('invalid switch value. ' + 'switch must be "on" or "off"') if key and not os.path.exists(key): self.abort("can't access the private key '%s'" % key)
def run(self, params, args): (state, key) = self.fillParams([ ('state', ), ('key', ) ]) if not len(args): self.abort('must supply at least one host')
self.runPlugins([host, state, key])
self.runPlugins([host, switch, key])
def run(self, params, args): (state, key) = self.fillParams([ ('state', ), ('key', ) ]) if not len(args): self.abort('must supply at least one host')
for host in self.getHostnames(args): if host == self.db.getHostname('localhost'): continue
hosts = [] if len(args) == 0: for host in self.getHostnames(args): if host == self.db.getHostname('localhost'): continue
def run(self, params, args):
part = disk.next_partition(part) if bootPart:
speedend = speedend + 1 if speedend != 0: speed = self.serialOptions[:speedend] else: speed = "9600" f.write("serial --unit=%s --speed=%s\n" %(unit, speed)) f.write("terminal --timeout=5 serial console\n") else: if os.access("%s/boot/grub/splash.xpm.gz" %(instRoot,), os.R_OK): f.write('splashimage=%s%sgrub/splash.xpm.gz\n' % (self.grubbyPartitionName(bootDevs[0]), cfPath)) f.write("hiddenmenu\n") for dev in self.getPhysicalDevices(grubTarget): usedDevs[dev] = 1 if self.password: f.write('password --md5 %s\n' %(self.password)) for (label, longlabel, version) in kernelList: kernelTag = "-" + version kernelFile = "%svmlinuz%s" % (cfPath, kernelTag) initrd = booty.makeInitrd (kernelTag, instRoot) f.write('title %s (%s)\n' % (longlabel, version)) f.write('\troot %s\n' % self.grubbyPartitionName(bootDevs[0])) realroot = getRootDevName(initrd, fsset, rootDev, instRoot) realroot = " root=%s" %(realroot,) if version.endswith("xen0") or (version.endswith("xen") and not os.path.exists("/proc/xen")): sermap = { "ttyS0": "com1", "ttyS1": "com2", "ttyS2": "com3", "ttyS3": "com4" } if self.serial and sermap.has_key(self.serialDevice) and \ self.serialOptions: hvs = "%s=%s" %(sermap[self.serialDevice], self.serialOptions) else: hvs = "" hvFile = "%sxen.gz-%s %s" % (cfPath, re.sub(r'xen0?', '', version), hvs) if self.hvArgs: hvFile = hvFile.rstrip() + " " + self.hvArgs f.write('\tkernel %s\n' %(hvFile,)) f.write('\tmodule %s ro%s' %(kernelFile, realroot)) if self.args.get(): f.write(' %s' % self.args.get()) f.write('\n') if os.access (instRoot + initrd, os.R_OK): f.write('\tmodule %sinitrd%s.img\n' % (cfPath, kernelTag)) else: f.write('\tkernel %s ro%s' % (kernelFile, realroot)) if self.args.get(): f.write(' %s' % self.args.get()) f.write('\n') if os.access (instRoot + initrd, os.R_OK): f.write('\tinitrd %sinitrd%s.img\n' % (cfPath, kernelTag)) for (label, longlabel, device) in chainList: if ((not longlabel) or (longlabel == "")): continue f.write('title %s\n' % (longlabel)) f.write('\trootnoverify %s\n' % self.grubbyPartitionName(device)) f.write('\tchainloader +1') f.write('\n') usedDevs[device] = 1 f.close() os.chmod(instRoot + "/boot/grub/grub.conf", self.perms) try: if os.access (instRoot + "/boot/grub/menu.lst", os.R_OK): os.rename(instRoot + "/boot/grub/menu.lst", instRoot + "/boot/grub/menu.lst.rpmsave") os.symlink("./grub.conf", instRoot + "/boot/grub/menu.lst") except: pass try: if os.access (instRoot + "/etc/grub.conf", os.R_OK): os.rename(instRoot + "/etc/grub.conf", instRoot + "/etc/grub.conf.rpmsave") os.symlink("../boot/grub/grub.conf", instRoot + "/etc/grub.conf") except: pass for dev in self.getPhysicalDevices(rootDev) + bootDevs: usedDevs[dev] = 1 if not os.access(instRoot + "/boot/grub/device.map", os.R_OK): f = open(instRoot + "/boot/grub/device.map", "w+") f.write(" devs = usedDevs.keys() usedDevs = {} for dev in devs: drive = getDiskPart(dev)[0] if usedDevs.has_key(drive): continue usedDevs[drive] = 1 devs = usedDevs.keys() devs.sort() for drive in devs: if not drive.startswith('md'): f.write("(%s) /dev/%s\n" % (self.grubbyDiskName(drive), drive)) f.close() if self.forceLBA32: forcelba = "--force-lba " else: forcelba = "" sysconf = '/etc/sysconfig/grub' if os.access (instRoot + sysconf, os.R_OK): self.perms = os.stat(instRoot + sysconf)[0] & 0777 os.rename(instRoot + sysconf, instRoot + sysconf + '.rpmsave') elif (os.path.islink(instRoot + sysconf) and os.readlink(instRoot + sysconf)[0] == '/'): os.rename(instRoot + sysconf, instRoot + sysconf + '.rpmsave') f = open(instRoot + sysconf, 'w+') f.write("boot=/dev/%s\n" %(grubTarget,)) if self.forceLBA32: f.write("forcelba=1\n") else: f.write("forcelba=0\n") f.close() cmds = [] for bootDev in bootDevs: gtPart = self.getMatchingPart(bootDev, grubTarget) gtDisk = self.grubbyPartitionName(getDiskPart(gtPart)[0]) bPart = self.grubbyPartitionName(bootDev) cmd = "root %s\n" % (bPart,) stage1Target = gtDisk if target == "partition": stage1Target = self.grubbyPartitionName(gtPart) cmd += "install %s%s/stage1 d %s %s/stage2 p %s%s/grub.conf" % \ (forcelba, grubPath, stage1Target, grubPath, bPart, grubPath) cmds.append(cmd) if not justConfigFile: if cfPath == "/": syncDataToDisk(bootDev, "/boot", instRoot) else: syncDataToDisk(bootDev, "/", instRoot) rhpl.executil.execWithRedirect( "/sbin/grub-install", ["/sbin/grub-install", "--just-copy"], stdout = "/dev/tty5", stderr = "/dev/tty5", root = instRoot) f = open('/tmp/grub-debug.log', 'w') os.system('md5sum /mnt/sysimage/boot/grub/stage2 >> /tmp/grub-install.log') for cmd in cmds: p = os.pipe() os.write(p[1], cmd + '\n') os.close(p[1]) f.write('cmd : %s\n' % cmd) import time if cfPath == "/": syncDataToDisk(bootDev, "/boot", instRoot) else: syncDataToDisk(bootDev, "/", instRoot) rhpl.executil.execWithRedirect('/sbin/grub' , [ "grub", "--batch", "--no-floppy", "--device-map=/boot/grub/device.map" ], stdin = p[0], stdout = "/tmp/grub-stdout.log", stderr = "/tmp/grub-stderr.log", root = instRoot) os.system('md5sum /mnt/sysimage/boot/grub/stage2 >> /tmp/grub-install.log') os.close(p[0]) f.close() c = "chroot /mnt/sysimage /sbin/grub-install '%s' " % stage1Target c += '>> /tmp/grub-install.log 2>&1' os.system(c) os.system('sync ; sync ; sync') os.system('md5sum /mnt/sysimage/boot/grub/stage2 >> /tmp/grub-install.log') os.system('cp /tmp/*log /mnt/sysimage/root') return "" def getMatchingPart(self, bootDev, target): bootName, bootPartNum = getDiskPart(bootDev) devices = self.getPhysicalDevices(target) for device in devices: name, partNum = getDiskPart(device) if name == bootName: return device return devices[0] def grubbyDiskName(self, name): return "hd%d" % self.drivelist.index(name) def grubbyPartitionName(self, dev): (name, partNum) = getDiskPart(dev) if partNum != None: return "(%s,%d)" % (self.grubbyDiskName(name), partNum) else: return "(%s)" %(self.grubbyDiskName(name)) def getBootloaderConfig(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev): config = bootloaderInfo.getBootloaderConfig(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev) liloTarget = bl.getDevice() config.addEntry("boot", '/dev/' + liloTarget, replace = 0) config.addEntry("map", "/boot/map", replace = 0) config.addEntry("install", "/boot/boot.b", replace = 0) message = "/boot/message" if self.pure is not None and not self.useGrubVal: config.addEntry("restricted", replace = 0) config.addEntry("password", self.pure, replace = 0) import language for lang in language.expandLangs(langs.getDefault()): fn = "/boot/message." + lang if os.access(instRoot + fn, os.R_OK): message = fn
def bootloaderSetupChoices(anaconda): if anaconda.dir == DISPATCH_BACK: return # FIXME: this is a hack... if flags.livecd: return if anaconda.id.ksdata: anaconda.id.bootloader.updateDriveList(anaconda.id.ksdata.bootloader["driveorder"]) else: anaconda.id.bootloader.updateDriveList()
if bootPart: anaconda.id.bootloader.setDevice(bootPart) dev = Device() dev.device = bootPart anaconda.id.fsset.add(FileSystemSetEntry(dev, None, fileSystemTypeGet("PPC PReP Boot"))) choices = anaconda.id.fsset.bootloaderChoices(anaconda.id.diskset, anaconda.id.bootloader) if not choices and iutil.getPPCMachine() != "iSeries": anaconda.dispatch.skipStep("instbootloader") else: anaconda.dispatch.skipStep("instbootloader", skip = 0) anaconda.id.bootloader.images.setup(anaconda.id.diskset, anaconda.id.fsset) if anaconda.id.bootloader.defaultDevice != None and choices: keys = choices.keys() if anaconda.id.bootloader.defaultDevice not in keys: log.warning("MBR not suitable as boot device; installing to partition") anaconda.id.bootloader.defaultDevice = "boot" anaconda.id.bootloader.setDevice(choices[anaconda.id.bootloader.defaultDevice][0]) elif choices and iutil.isMactel() and choices.has_key("boot"): anaconda.id.bootloader.setDevice(choices["boot"][0]) elif choices and choices.has_key("mbr") and not \ (choices.has_key("boot") and choices["boot"][1] == N_("RAID Device")): anaconda.id.bootloader.setDevice(choices["mbr"][0]) elif choices and choices.has_key("boot"): anaconda.id.bootloader.setDevice(choices["boot"][0])
if self.serial: unit = self.serialDevice[-1] config.addEntry("serial=%s" %(unit,)) else: if os.access(instRoot + message, os.R_OK): config.addEntry("message", message, replace = 0) if not config.testEntry('lba32'): if self.forceLBA32 or (bl.above1024 and rhpl.getArch() != "x86_64"): config.addEntry("lba32", replace = 0) return config def upgradeGrub(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfigFile): if justConfigFile: return "" theDev = None for (fn, stanza) in [ ("/etc/sysconfig/grub", "boot="), ("/boot/grub/grub.conf", " try: f = open(instRoot + fn, "r") except: continue lines = f.readlines() f.close() for line in lines: if line.startswith(stanza): theDev = checkbootloader.getBootDevString(line) break if theDev is not None: break if theDev is None: return "" sysconf = '/etc/sysconfig/grub' if not os.access(instRoot + sysconf, os.R_OK): f = open(instRoot + sysconf, "w+") f.write("boot=%s\n" %(theDev,)) if self.forceLBA32: f.write("forcelba=1\n") else: f.write("forcelba=0\n") f.close() bootDev = fsset.getEntryByMountPoint("/boot") grubPath = "/grub" cfPath = "/" if not bootDev: bootDev = fsset.getEntryByMountPoint("/") grubPath = "/boot/grub" cfPath = "/boot/" masterBootDev = bootDev.device.getDevice(asBoot = 0) if masterBootDev[0:2] == 'md': rootDevs = checkbootloader.getRaidDisks(masterBootDev, raidLevel=1, stripPart = 0) else: rootDevs = [masterBootDev] if theDev[5:7] == 'md': stage1Devs = checkbootloader.getRaidDisks(theDev[5:], raidLevel=1) else: stage1Devs = [theDev[5:]] for stage1Dev in stage1Devs: grubbyStage1Dev = self.grubbyPartitionName(stage1Dev) grubbyRootPart = self.grubbyPartitionName(rootDevs[0]) for rootDev in rootDevs: testGrubbyRootDev = getDiskPart(rootDev)[0] testGrubbyRootDev = self.grubbyPartitionName(testGrubbyRootDev) if grubbyStage1Dev == testGrubbyRootDev: grubbyRootPart = self.grubbyPartitionName(rootDev) break cmd = "root %s\ninstall %s/stage1 d %s %s/stage2 p %s%s/grub.conf" \ % (grubbyRootPart, grubPath, grubbyStage1Dev, grubPath, grubbyRootPart, grubPath) if not justConfigFile: rhpl.executil.execWithRedirect( "/sbin/grub-install", ["/sbin/grub-install", "--just-copy"], stdout = "/dev/tty5", stderr = "/dev/tty5", root = instRoot) import isys isys.sync() isys.sync() isys.sync() p = os.pipe() os.write(p[1], cmd + '\n') os.close(p[1]) rhpl.executil.execWithRedirect('/sbin/grub' , [ "grub", "--batch", "--no-floppy", "--device-map=/boot/grub/device.map" ], stdin = p[0], stdout = "/dev/tty5", stderr = "/dev/tty5", root = instRoot) os.close(p[0]) return "" def write(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig, intf): if self.doUpgradeOnly: if self.useGrubVal: self.upgradeGrub(instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig) import isys cdrw = isys.ideCdRwList() torem = [] for device in cdrw: torem.append("%s=ide-scsi" %(device,)) for fn in ("/etc/lilo.conf", "/boot/grub/grub.conf", "/etc/lilo.conf.anaconda"): if not os.path.exists(instRoot + fn): continue f = open(instRoot + fn, "r") buf = f.read() f.close() for dev in torem: buf = buf.replace(dev, "") f = open(instRoot + fn, "w") f.write(buf) f.close() return if len(kernelList) < 1: self.noKernelsWarn(intf) str = self.writeGrub(instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig | (not self.useGrubVal)) if self.useGrubVal and os.access(instRoot + '/etc/lilo.conf', os.R_OK): os.rename(instRoot + "/etc/lilo.conf", instRoot + "/etc/lilo.conf.anaconda") def getArgList(self): args = bootloaderInfo.getArgList(self) if self.forceLBA32: args.append("--lba32") if self.password: args.append("--md5pass=%s" %(self.password)) return args def __init__(self): bootloaderInfo.__init__(self) self.useGrubVal = 1 self.kernelLocation = "/boot/" self.configfile = "/etc/lilo.conf" self.password = None self.pure = None class s390BootloaderInfo(bootloaderInfo): def getBootloaderConfig(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev): images = bl.images.getImages() lilo = LiloConfigFile () self.perms = 0600 if os.access (instRoot + self.configfile, os.R_OK): self.perms = os.stat(instRoot + self.configfile)[0] & 0777 lilo.read (instRoot + self.configfile) os.rename(instRoot + self.configfile, instRoot + self.configfile + '.rpmsave') for label in lilo.listImages(): (fsType, sl, path, other) = lilo.getImage(label) if fsType == "other": continue if not os.access(instRoot + sl.getPath(), os.R_OK): lilo.delImage(label) rootDev = fsset.getEntryByMountPoint("/").device.getDevice() if not rootDev: raise RuntimeError, "Installing zipl, but there is no root device" if rootDev == defaultDev: lilo.addEntry("default", kernelList[0][0]) else: lilo.addEntry("default", chainList[0][0]) for (label, longlabel, version) in kernelList: kernelTag = "-" + version kernelFile = self.kernelLocation + "vmlinuz" + kernelTag try: lilo.delImage(label) except IndexError, msg: pass sl = LiloConfigFile(imageType = "image", path = kernelFile) initrd = booty.makeInitrd (kernelTag, instRoot) sl.addEntry("label", label) if os.access (instRoot + initrd, os.R_OK): sl.addEntry("initrd", "%sinitrd%s.img" %(self.kernelLocation, kernelTag)) sl.addEntry("read-only") sl.addEntry("root", '/dev/' + rootDev) sl.addEntry("ipldevice", '/dev/' + rootDev[:-1]) if self.args.get(): sl.addEntry('append', '"%s"' % self.args.get()) lilo.addImage (sl) for (label, longlabel, device) in chainList: if ((not label) or (label == "")): continue try: (fsType, sl, path, other) = lilo.getImage(label) lilo.delImage(label) except IndexError: sl = LiloConfigFile(imageType = "other", path = "/dev/%s" %(device)) sl.addEntry("optional") sl.addEntry("label", label) lilo.addImage (sl) imageNames = {} for label in lilo.listImages(): imageNames[label] = 1 for label in lilo.listImages(): (fsType, sl, path, other) = lilo.getImage(label) if sl.testEntry('alias'): alias = sl.getEntry('alias') if imageNames.has_key(alias): sl.delEntry('alias') imageNames[alias] = 1 if lilo.testEntry('single-key'): singleKeys = {} turnOff = 0 for label in imageNames.keys(): l = label[0] if singleKeys.has_key(l): turnOff = 1 singleKeys[l] = 1 if turnOff: lilo.delEntry('single-key') return lilo def writeChandevConf(self, bl, instroot): cf = "/etc/chandev.conf" self.perms = 0644 if bl.args.chandevget(): fd = os.open(instroot + "/etc/chandev.conf", os.O_WRONLY | os.O_CREAT) os.write(fd, "noauto\n") for cdev in bl.args.chandevget(): os.write(fd,'%s\n' % cdev) os.close(fd) return ""
def bootloaderSetupChoices(anaconda): if anaconda.dir == DISPATCH_BACK: return # FIXME: this is a hack... if flags.livecd: return if anaconda.id.ksdata: anaconda.id.bootloader.updateDriveList(anaconda.id.ksdata.bootloader["driveorder"]) else: anaconda.id.bootloader.updateDriveList()
bootDev = anaconda.id.fsset.getEntryByMountPoint("/") if not bootDev: bootDev = anaconda.id.fsset.getEntryByMountPoint("/boot") part = partedUtils.get_partition_by_name(anaconda.id.diskset.disks, bootDev.device.getDevice()) if part and partedUtils.end_sector_to_cyl(part.geom.dev, part.geom.end) >= 1024: anaconda.id.bootloader.above1024 = 1
def writeZipl(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfigFile): images = bl.images.getImages() rootDev = fsset.getEntryByMountPoint("/").device.getDevice() cf = '/etc/zipl.conf' self.perms = 0600 if os.access (instRoot + cf, os.R_OK): self.perms = os.stat(instRoot + cf)[0] & 0777 os.rename(instRoot + cf, instRoot + cf + '.rpmsave') f = open(instRoot + cf, "w+") f.write('[defaultboot]\n') f.write('default=' + kernelList[0][0] + '\n') f.write('target=%s\n' % (self.kernelLocation)) cfPath = "/boot/" for (label, longlabel, version) in kernelList: kernelTag = "-" + version kernelFile = "%svmlinuz%s" % (cfPath, kernelTag) initrd = booty.makeInitrd (kernelTag, instRoot) f.write('[%s]\n' % (label)) f.write('\timage=%s\n' % (kernelFile)) if os.access (instRoot + initrd, os.R_OK): f.write('\tramdisk=%sinitrd%s.img,0x1800000\n' %(self.kernelLocation, kernelTag)) realroot = getRootDevName(initrd, fsset, rootDev, instRoot) f.write('\tparameters="root=%s' %(realroot,)) if bl.args.get(): f.write(' %s' % (bl.args.get())) f.write('"\n') f.close() if not justConfigFile: argv = [ "/sbin/zipl" ] rhpl.executil.execWithRedirect(argv[0], argv, root = instRoot, stdout = "/dev/stdout", stderr = "/dev/stderr") return "" def write(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig, intf): str = self.writeZipl(instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig | (not self.useZiplVal)) str = self.writeChandevConf(bl, instRoot)
def bootloaderSetupChoices(anaconda): if anaconda.dir == DISPATCH_BACK: return # FIXME: this is a hack... if flags.livecd: return if anaconda.id.ksdata: anaconda.id.bootloader.updateDriveList(anaconda.id.ksdata.bootloader["driveorder"]) else: anaconda.id.bootloader.updateDriveList()
def writeBootloader(anaconda): def dosync():
def __init__(self): bootloaderInfo.__init__(self) self.useZiplVal = 1 self.kernelLocation = "/boot/" self.configfile = "/etc/zipl.conf" class alphaBootloaderInfo(bootloaderInfo): def wholeDevice (self, path): (device, foo) = getDiskPart(path) return device def partitionNum (self, path): (foo, partitionNumber) = getDiskPart(path) return partitionNumber + 1 def useMilo (self): try: f = open ('/proc/cpuinfo', 'ro') except: return lines = f.readlines () f.close() serial = "" for line in lines: if line.find("system serial number") != -1: serial = string.strip (string.split (line, ':')[1]) break if serial and len (serial) >= 4 and serial.startswith("MILO"): return 1 else: return 0 def writeAboot(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig): rootDevice = fsset.getEntryByMountPoint("/").device.getDevice() if fsset.getEntryByMountPoint("/boot"): bootDevice = fsset.getEntryByMountPoint("/boot").device.getDevice() else: bootDevice = rootDevice bootnotroot = bootDevice != rootDevice if os.path.isfile(instRoot + self.configfile): os.rename (instRoot + self.configfile, instRoot + self.configfile + ".rpmsave") if bootnotroot: if not os.path.isdir (instRoot + '/boot/etc'): os.mkdir(instRoot + '/boot/etc', 0755) os.symlink("../boot" + self.configfile, instRoot + self.configfile) cfPath = instRoot + "/boot" + self.configfile kernelPath = '/' else: cfPath = instRoot + self.configfile kernelPath = self.kernelLocation if os.access (cfPath, os.R_OK): self.perms = os.stat(cfPath)[0] & 0777 os.rename(cfPath, cfPath + '.rpmsave') f = open (cfPath, 'w+') f.write (" if bootnotroot: f.write (" f.write (" bpn = self.partitionNum(bootDevice) lines = 0 for (kernel, tag, kernelTag) in kernelList: kernelFile = "%svmlinuz-%s" %(kernelPath, kernelTag) f.write("%d:%d%s" %(lines, bpn, kernelFile)) initrd = booty.makeInitrd (kernelTag, instRoot) if os.access(instRoot + initrd, os.R_OK): f.write(" initrd=%sinitrd-%s.img" %(kernelPath, kernelTag)) realroot = getRootDevName(initrd, fsset, rootDevice, instRoot) f.write(" root=%s" %(realroot,)) args = self.args.get() if args: f.write(" %s" %(args,)) f.write("\n") lines = lines + 1 f.close () del f if not justConfig: wbd = self.wholeDevice (bootDevice) bdpn = self.partitionNum (bootDevice) args = ("swriteboot", ("/dev/%s" % wbd), "/boot/bootlx") rhpl.executil.execWithRedirect ('/sbin/swriteboot', args, root = instRoot, stdout = "/dev/tty5", stderr = "/dev/tty5") args = ("abootconf", ("/dev/%s" % wbd), str (bdpn)) rhpl.executil.execWithRedirect ('/sbin/abootconf', args, root = instRoot, stdout = "/dev/tty5", stderr = "/dev/tty5") def write(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig, intf): if len(kernelList) < 1: self.noKernelsWarn(intf) if self.useMilo(): intf.messageWindow(_("MILO Not Supported"), "This system requires the support of MILO to " + "boot linux (MILO is not included in this " + "distribution.) The installation of the " + "bootloader can't be completed on this system.") else: self.writeAboot(instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig) def __init__(self): bootloaderInfo.__init__(self) self.useGrubVal = 0 self.configfile = "/etc/aboot.conf" self.password = None self.pure = None class ppcBootloaderInfo(bootloaderInfo): def getBootDevs(self, fs, bl): import fsset devs = [] machine = rhpl.getPPCMachine() if machine == 'pSeries': for entry in fs.entries: if isinstance(entry.fsystem, fsset.prepbootFileSystem) \ and entry.format: devs.append('/dev/%s' % (entry.device.getDevice(),)) elif machine == 'PMac': for entry in fs.entries: if isinstance(entry.fsystem, fsset.applebootstrapFileSystem) \ and entry.format: devs.append('/dev/%s' % (entry.device.getDevice(),)) if len(devs) == 0: if machine == 'Pegasos': entry = fs.getEntryByMountPoint('/boot') if not entry: entry = fs.getEntryByMountPoint('/') if entry: dev = "/dev/%s" % (entry.device.getDevice(asBoot=1),) devs.append(dev) else: if bl.getDevice(): devs.append("/dev/%s" % bl.getDevice()) return devs def writeYaboot(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfigFile): from flags import flags yabootTarget = string.join(self.getBootDevs(fsset, bl)) bootDev = fsset.getEntryByMountPoint("/boot") if bootDev: cf = "/boot/etc/yaboot.conf" cfPath = "" if not os.path.isdir(instRoot + "/boot/etc"): os.mkdir(instRoot + "/boot/etc") else: bootDev = fsset.getEntryByMountPoint("/") cfPath = "/boot" cf = "/etc/yaboot.conf" bootDev = bootDev.device.getDevice(asBoot = 1) f = open(instRoot + cf, "w+") f.write(" f.write("boot=%s\n" %(yabootTarget,)) f.write("init-message=Welcome to %s!\\nHit <TAB> for boot options\n\n" %(getProductName(),)) (name, partNum) = getDiskPart(bootDev) if rhpl.getPPCMachine() == "Pegasos": partno = partNum else: partno = partNum + 1 f.write("partition=%s\n" %(partno,)) f.write("timeout=80\n") f.write("install=/usr/lib/yaboot/yaboot\n") f.write("delay=5\n") f.write("enablecdboot\n") f.write("enableofboot\n") f.write("enablenetboot\n") yabootProg = "/sbin/mkofboot" if rhpl.getPPCMachine() == "PMac": for (label, longlabel, device) in chainList: if ((not label) or (label == "")): continue f.write("macosx=/dev/%s\n" %(device,)) break f.write("magicboot=/usr/lib/yaboot/ofboot\n") if rhpl.getPPCMachine() == "pSeries": f.write("nonvram\n") f.write("fstype=raw\n") if rhpl.getPPCMachine() == "Pegasos": f.write("nonvram\n") f.write("mntpoint=/boot/yaboot\n") f.write("usemount\n") if not os.access(instRoot + "/boot/yaboot", os.R_OK): os.mkdir(instRoot + "/boot/yaboot") yabootProg = "/sbin/ybin" if self.password: f.write("password=%s\n" %(self.password,)) f.write("restricted\n") f.write("\n") rootDev = fsset.getEntryByMountPoint("/").device.getDevice() for (label, longlabel, version) in kernelList: kernelTag = "-" + version kernelFile = "%s/vmlinuz%s" %(cfPath, kernelTag) f.write("image=%s\n" %(kernelFile,)) f.write("\tlabel=%s\n" %(label,)) f.write("\tread-only\n") initrd = booty.makeInitrd(kernelTag, instRoot) if os.access(instRoot + initrd, os.R_OK): f.write("\tinitrd=%s/initrd%s.img\n" %(cfPath,kernelTag)) append = "%s" %(self.args.get(),) realroot = getRootDevName(initrd, fsset, rootDev, instRoot) if not realroot.startswith("LABEL="): f.write("\troot=%s\n" %(realroot,)) else: if len(append) > 0: append = "%s root=%s" %(append,realroot) else: append = "root=%s" %(realroot,) if len(append) > 0: f.write("\tappend=\"%s\"\n" %(append,)) f.write("\n") f.close() os.chmod(instRoot + cf, 0600) import isys
def bootloaderSetupChoices(anaconda): if anaconda.dir == DISPATCH_BACK: return # FIXME: this is a hack... if flags.livecd: return if anaconda.id.ksdata: anaconda.id.bootloader.updateDriveList(anaconda.id.ksdata.bootloader["driveorder"]) else: anaconda.id.bootloader.updateDriveList()
justConfigFile = not flags.setupFilesystems if anaconda.id.bootloader.defaultDevice == -1: return if anaconda.isKickstart and anaconda.id.bootloader.doUpgradeOnly: import checkbootloader (bootType, theDev) = checkbootloader.getBootloaderTypeAndBoot(anaconda.rootPath) anaconda.id.bootloader.doUpgradeonly = 1 if bootType == "GRUB": anaconda.id.bootloader.useGrubVal = 1 anaconda.id.bootloader.setDevice(theDev) else: anaconda.id.bootloader.doUpgradeOnly = 0 if not justConfigFile: w = anaconda.intf.waitWindow(_("Bootloader"), _("Installing bootloader...")) kernelList = [] otherList = [] root = anaconda.id.fsset.getEntryByMountPoint('/') if root: rootDev = root.device.getDevice()
ybinargs = [ yabootProg, "-f", "-C", cf ] if not flags.test: rhpl.executil.execWithRedirect(ybinargs[0], ybinargs, stdout = "/dev/tty5", stderr = "/dev/tty5", root = instRoot) if (not os.access(instRoot + "/etc/yaboot.conf", os.R_OK) and os.access(instRoot + "/boot/etc/yaboot.conf", os.R_OK)): os.symlink("../boot/etc/yaboot.conf", instRoot + "/etc/yaboot.conf") return "" def setPassword(self, val, isCrypted = 1): self.password = val def write(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig, intf): if len(kernelList) >= 1: str = self.writeYaboot(instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig) else: self.noKernelsWarn(intf) def __init__(self): bootloaderInfo.__init__(self) self.useYabootVal = 1 self.kernelLocation = "/boot" self.configfile = "/etc/yaboot.conf" class iseriesBootloaderInfo(bootloaderInfo): def ddFile(self, inf, of, bs = 4096): src = os.open(inf, os.O_RDONLY) dest = os.open(of, os.O_WRONLY | os.O_CREAT) size = 0 buf = os.read(src, bs) while len(buf) > 0: size = size + len(buf) os.write(dest, buf) buf = os.read(src, bs) os.close(src) os.close(dest) return size def write(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig, intf): if len(kernelList) < 1: self.noKernelsWarn(intf) return rootDevice = fsset.getEntryByMountPoint("/").device.getDevice() for (kernel, tag, kernelTag) in kernelList: cmdFile = "%scmdline-%s" %(self.kernelLocation, kernelTag) initrd = "%sinitrd-%s.img" %(self.kernelLocation, kernelTag) realroot = getRootDevName(initrd, fsset, rootDevice, instRoot) f = open(instRoot + cmdFile, "w") f.write("ro root=%s" %(realroot,)) if bl.args.get(): f.write(" %s" %(bl.args.get(),)) f.write("\n") f.close() os.chmod(instRoot + cmdFile, 0644) kernel, tag, kernelTag = kernelList[0] kernelFile = "%svmlinitrd-%s" %(self.kernelLocation, kernelTag) bootDev = bl.getDevice() if bootDev: try: self.ddFile(instRoot + kernelFile, "%s/dev/%s" %(instRoot, bootDev)) except Exception, e: pass else: pass for side in ("C", "B"): wrotekernel = 0 try: self.ddFile(instRoot + kernelFile, "%s/proc/iSeries/mf/%s/vmlinux" %(instRoot, side)) wrotekernel = 1 except Exception, e: pass if wrotekernel == 1: try: f = open("%s/proc/iSeries/mf/%s/cmdline" %(instRoot, side), "w+") f.write(" " * 255) f.close() self.ddFile("%s/%scmdline-%s" %(instRoot, self.kernelLocation, kernelTag), "%s/proc/iSeries/mf/%s/cmdline" %(instRoot, side)) except Exception, e: pass f = open(instRoot + "/proc/iSeries/mf/side", "w") f.write("C") f.close() def __init__(self): bootloaderInfo.__init__(self) self.kernelLocation = "/boot/" class isolinuxBootloaderInfo(bootloaderInfo): def __init__(self): bootloaderInfo.__init__(self) self.kernelLocation = "/boot" self.configfile = "/boot/isolinux/isolinux.cfg" def write(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig, intf = None): if not os.path.isdir(instRoot + "/boot/isolinux"): os.mkdir(instRoot + "/boot/isolinux") f = open(instRoot + "/boot/isolinux/isolinux.cfg", "w+") f.write(" f.write("prompt 1\n") f.write("timeout 600\n") for (label, longlabel, version) in kernelList: shutil.copy("%s/boot/vmlinuz-%s" %(instRoot, version), "%s/boot/isolinux/vmlinuz" %(instRoot,)) shutil.copy("%s/boot/initrd-%s.img" %(instRoot, version), "%s/boot/isolinux/initrd.img" %(instRoot,)) f.write("label linux\n") f.write("\tkernel vmlinuz\n") f.write("\tappend initrd=initrd.img,initlive.gz\n") f.write("\n") break f.close() os.chmod(instRoot + "/boot/isolinux/isolinux.cfg", 0600) shutil.copy(instRoot + "/usr/lib/syslinux/isolinux-debug.bin", instRoot + "/boot/isolinux/isolinux.bin") class sparcBootloaderInfo(bootloaderInfo): def writeSilo(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfigFile): from flags import flags bootDev = fsset.getEntryByMountPoint("/boot") mf = '/silo.message' if bootDev: cf = "/boot/silo.conf" mfdir = '/boot' cfPath = "" if not os.path.isdir(instRoot + "/boot"): os.mkdir(instRoot + "/boot") else: bootDev = fsset.getEntryByMountPoint("/") cf = "/etc/silo.conf" mfdir = '/etc' cfPath = "/boot" bootDev = bootDev.device.getDevice(asBoot = 1) f = open(instRoot + mfdir + mf, "w+") f.write("Welcome to %s!\nHit <TAB> for boot options\n\n" % \ (getProductName(),)) f.close() os.chmod(instRoot + mfdir + mf, 0600) f = open(instRoot + cf, "w+") f.write(" f.write(" f.write("message=%s\n" % (mf,)) f.write("timeout=50\n") (name, partNum) = getDiskPart(bootDev) partno = partNum + 1 f.write("partition=%s\n" % (partno,)) if self.password: f.write("password=%s\n" % (self.password,)) f.write("restricted\n") f.write("default=%s\n" % (kernelList[0][0],)) f.write("\n") rootDev = fsset.getEntryByMountPoint("/").device.getDevice() for (label, longlabel, version) in kernelList: kernelTag = "-" + version kernelFile = "%s/vmlinuz%s" % (cfPath, kernelTag) f.write("image=%s\n" % (kernelFile,)) f.write("\tlabel=%s\n" % (label,)) f.write("\tread-only\n") initrd = booty.makeInitrd(kernelTag, instRoot) if os.access(instRoot + initrd, os.R_OK): f.write("\tinitrd=%s/initrd%s.img\n" % (cfPath, kernelTag)) append = "%s" % (self.args.get(),) realroot = getRootDevName(initrd, fsset, rootDev, instRoot) if not realroot.startswith("LABEL="): f.write("\troot=%s\n" % (realroot,)) else: if len(append) > 0: append = "%s root=%s" % (append, realroot) else: append = "root=%s" % (realroot,) if len(append) > 0: f.write("\tappend=\"%s\"\n" % (append,)) f.write("\n") f.close() os.chmod(instRoot + cf, 0600) import isys isys.sync() isys.sync() isys.sync() backup = "%s/backup.b" % (cfPath,) sbinargs = ["/sbin/silo", "-f", "-C", cf, "-S", backup] if butil.getSparcMachine() == "sun4u": sbinargs += ["-u"] else: sbinargs += ["-U"] if not flags.test: rhpl.executil.execWithRedirect(sbinargs[0], sbinargs, stdout = "/dev/tty5", stderr = "/dev/tty5", root = instRoot) if (not os.access(instRoot + "/etc/silo.conf", os.R_OK) and os.access(instRoot + "/boot/etc/silo.conf", os.R_OK)): os.symlink("../boot/etc/silo.conf", instRoot + "/etc/silo.conf") return "" def setPassword(self, val, isCrypted = 1): self.password = val def write(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig, intf): if len(kernelList) >= 1: self.writeSilo(instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfig) else: self.noKernelsWarn(intf) def __init__(self): bootloaderInfo.__init__(self) self.useSiloVal = 1 self.kernelLocation = "/boot" self.configfile = "/etc/silo.conf" def getDiskPart(dev): cut = len(dev) if (dev.startswith('rd/') or dev.startswith('ida/') or dev.startswith('cciss/') or dev.startswith('sx8/') or dev.startswith('mapper/')): if dev[-2] == 'p': cut = -1 elif dev[-3] == 'p': cut = -2
def dosync(): isys.sync() isys.sync() isys.sync()
rootDev = None kernelLabel = None kernelLongLabel = None def rectifyLuksName(anaconda, name): if name is not None and name.startswith('mapper/luks-'): try: newname = anaconda.id.partitions.encryptedDevices.get(name[12:]) if newname is None: for luksdev in anaconda.id.partitions.encryptedDevices.values(): if os.path.basename(luksdev.getDevice(encrypted=1)) == name[12:]: newname = luksdev break name = newname.getDevice() except: pass return name defaultDev = anaconda.id.bootloader.images.getDefault() defaultDev = rectifyLuksName(anaconda, defaultDev) for (dev, (label, longlabel, type)) in anaconda.id.bootloader.images.getImages().items(): dev = rectifyLuksName(anaconda, dev) if (dev == rootDev) or (rootDev is None and kernelLabel is None): kernelLabel = label kernelLongLabel = longlabel elif dev == defaultDev: otherList = [(label, longlabel, dev)] + otherList else: otherList.append((label, longlabel, dev)) if kernelLabel is None and not flags.livecd: log.error("unable to find default image, bailing") if not justConfigFile: w.pop() return plainLabelUsed = 0 defkern = "kernel" for (version, arch, nick) in anaconda.backend.kernelVersionList(): if plainLabelUsed: kernelList.append(("%s-%s" %(kernelLabel, nick), "%s-%s" %(kernelLongLabel, nick), version)) else: kernelList.append((kernelLabel, kernelLongLabel, version)) if nick in ("hypervisor", "guest"): defkern = "kernel-xen-%s" %(nick,) elif nick != "base": defkern = "kernel-%s" %(nick,) plainLabelUsed = 1 f = open(anaconda.rootPath + "/etc/sysconfig/kernel", "w+") f.write(" " if rootDev == defaultDev: f.write("UPDATEDEFAULT=yes\n")
if dev[-2] in string.digits: cut = -2 elif dev[-1] in string.digits: cut = -1 name = dev[:cut] if name[-1] == 'p': for letter in name: if letter not in string.letters and letter != "/": name = name[:-1] break if cut < 0: partNum = int(dev[cut:]) - 1
def dosync(): isys.sync() isys.sync() isys.sync()
f.write("UPDATEDEFAULT=no\n") f.write("\n") f.write(" f.write("DEFAULTKERNEL=%s\n" %(defkern,)) f.close() dosync()
partNum = None return (name, partNum) def getRootDevName(initrd, fsset, rootDev, instRoot): if not os.access(instRoot + initrd, os.R_OK): return "/dev/%s" % (rootDev,)
def rectifyLuksName(anaconda, name): if name is not None and name.startswith('mapper/luks-'): try: newname = anaconda.id.partitions.encryptedDevices.get(name[12:]) if newname is None: for luksdev in anaconda.id.partitions.encryptedDevices.values(): if os.path.basename(luksdev.getDevice(encrypted=1)) == name[12:]: newname = luksdev break name = newname.getDevice() except: pass return name
import time for i in range(0,3): anaconda.id.bootloader.write(anaconda.rootPath, anaconda.id.fsset, anaconda.id.bootloader, anaconda.id.instLanguage, kernelList, otherList, defaultDev, justConfigFile, anaconda.intf) dosync() time.sleep(1) if not justConfigFile: w.pop() except bootloaderInfo.BootyNoKernelWarning: if not justConfigFile: w.pop() if anaconda.intf: anaconda.intf.messageWindow(_("Warning"), _("No kernel packages were installed on your " "system. Your boot loader configuration " "will not be changed.")) dosync() def getBootloader(): if not flags.livecd: return booty.getBootloader()
rootEntry = fsset.getEntryByMountPoint("/") if rootEntry.getLabel() is not None and rootEntry.device.getDevice().find('/mpath') == -1: return "LABEL=%s" %(rootEntry.getLabel(),) return "/dev/%s" %(rootDev,) except: return "/dev/%s" %(rootDev,) def getProductName(): if os.access("/etc/redhat-release", os.R_OK): f = open("/etc/redhat-release", "r") lines = f.readlines() f.close() for buf in lines: relidx = buf.find(" release") if relidx != -1: return buf[:relidx] if os.access("/tmp/product/.buildstamp", os.R_OK): path = "/tmp/product/.buildstamp" elif os.access("/.buildstamp", os.R_OK): path = "/.buildstamp"
def rectifyLuksName(anaconda, name): if name is not None and name.startswith('mapper/luks-'): try: newname = anaconda.id.partitions.encryptedDevices.get(name[12:]) if newname is None: for luksdev in anaconda.id.partitions.encryptedDevices.values(): if os.path.basename(luksdev.getDevice(encrypted=1)) == name[12:]: newname = luksdev break name = newname.getDevice() except: pass return name
return bootloaderInfo.isolinuxBootloaderInfo() def hasWindows(bl): foundWindows = False for (k,v) in bl.images.getImages().iteritems(): if v[0].lower() == 'other' and v[2] in bootloaderInfo.dosFilesystems: foundWindows = True break return foundWindows
path = None if path is not None: f = open(path, "r") lines = f.readlines() f.close() if len(lines) >= 2: return lines[1][:-1] return "Red Hat Linux"
def getBootloader(): if not flags.livecd: return booty.getBootloader() else: return bootloaderInfo.isolinuxBootloaderInfo()
s += "; import from %s\n" % filename
s += "\n;Imported from %s\n\n" % filename
def hostlocal(self, name, dnszone): "Appends any manually defined hosts to domain file" filename = '/var/named/%s.domain.local' % name s = '' if os.path.isfile(filename): s += "; import from %s\n" % filename file = open(filename, 'r') s += file.read() file.close() s += '\n' return s
s += '\n'
else: s += "</file>\n" s += '<file name="%s" perms="0644">\n' % filename s += ';Extra host mappings go here. Example\n' s += ';myhost A 10.1.1.1\n'
def hostlocal(self, name, dnszone): "Appends any manually defined hosts to domain file" filename = '/var/named/%s.domain.local' % name s = '' if os.path.isfile(filename): s += "; import from %s\n" % filename file = open(filename, 'r') s += file.read() file.close() s += '\n' return s
os.system('cp /tmp/*log /mnt/sysimage/root')
os.system('cp /tmp/*log /tmp/*debug /mnt/sysimage/root')
def writeGrub(self, instRoot, fsset, bl, langs, kernelList, chainList, defaultDev, justConfigFile): if len(kernelList) < 1: return "" images = bl.images.getImages() rootDev = fsset.getEntryByMountPoint("/").device.getDevice()
self.db.execute("select networks.ip, networks.device " +\ "from networks, nodes where " +\ "nodes.name='%s' " % (host) +\
self.db.execute("select networks.ip, networks.device, " +\ "subnets.netmask from networks, nodes, " +\ "subnets where nodes.name='%s' " % (host)+\ "and networks.subnet=subnets.id " +\
def run_sunos(self, host): # Ignore IPMI devices and get all the other configured # interfaces self.db.execute("select networks.ip, networks.device " +\ "from networks, nodes where " +\ "nodes.name='%s' " % (host) +\ "and networks.device!='ipmi' " +\ "and networks.node=nodes.id")
(ip, device) = row
(ip, device, netmask) = row
def run_sunos(self, host): # Ignore IPMI devices and get all the other configured # interfaces self.db.execute("select networks.ip, networks.device " +\ "from networks, nodes where " +\ "nodes.name='%s' " % (host) +\ "and networks.device!='ipmi' " +\ "and networks.node=nodes.id")
self.write_host_file_sunos(ip, device)
self.write_host_file_sunos(ip, netmask, device)
def run_sunos(self, host): # Ignore IPMI devices and get all the other configured # interfaces self.db.execute("select networks.ip, networks.device " +\ "from networks, nodes where " +\ "nodes.name='%s' " % (host) +\ "and networks.device!='ipmi' " +\ "and networks.node=nodes.id")
def write_host_file_sunos(self, ip, device):
def write_host_file_sunos(self, ip, netmask, device):
def write_host_file_sunos(self, ip, device): s = '<file name="/etc/hostname.%s">\n' % device s += "%s\n" % ip s += '</file>\n' self.addText(s)
s += "%s\n" % ip
s += "%s netmask %s\n" % (ip, netmask)
def write_host_file_sunos(self, ip, device): s = '<file name="/etc/hostname.%s">\n' % device s += "%s\n" % ip s += '</file>\n' self.addText(s)
Abort('unkown os "%s"' % arg)
Abort('unknown os "%s"' % arg)
def getOSNames(self, args=None): """Returns a list of OS names. For each arg in the ARGS list normalize the name to one of either 'linux' or 'sunos' as they are the only supported OSes. If the ARGS list is empty return a list of all supported OS names. """
if self.collate:
if collate:
def run(self, params, args): (args, command) = self.fillPositionalArgs(('command', ))
<arg type='boolean' name='managed'>
<param type='boolean' name='managed'>
def kill(self): os.kill(self.p.pid, 9)
</arg> <arg type='boolean' name='x11'>
</param> <param type='boolean' name='x11'>
def kill(self): os.kill(self.p.pid, 9)
</arg> <arg type='string' name='timeout'>
</param> <param type='string' name='timeout'>
def kill(self): os.kill(self.p.pid, 9)
</arg> <arg type='string' name='delay'>
</param> <param type='string' name='delay'>
def kill(self): os.kill(self.p.pid, 9)
</arg> <arg type='string' name='stats'>
</param> <param type='string' name='stats'>
def kill(self): os.kill(self.p.pid, 9)
</arg> <arg type='string' name='collate'>
</param> <param type='string' name='collate'>
def kill(self): os.kill(self.p.pid, 9)
</arg>
</param>
def kill(self): os.kill(self.p.pid, 9)
is run on all known hosts.
is run on all 'managed' hosts. By default, all compute nodes are 'managed' nodes. To determine if a host is managed, execute: 'rocks list host attr hostname | grep managed'. If you see output like: 'compute-0-0: managed true', then the host is managed.
def kill(self): os.kill(self.p.pid, 9)
break
continue
def run_linux(self, host): self.db.execute("""select distinctrow net.mac, net.ip, net.device, if(net.subnet, s.netmask, NULL), net.vlanid, net.subnet, net.module, s.mtu, net.options, net.channel from networks net, nodes n, subnets s where net.node = n.id and if(net.subnet, net.subnet = s.id, true) and n.name = "%s" order by net.id""" % (host))
cmd = 'ssh %s "/sbin/service iptables stop" ' % host
cmd = 'ssh %s "/sbin/service iptables stop ' % host
def run(self, params, args): hosts = self.getHostnames(args, managed_only=1)
cmd += ' ; "/sbin/service network restart" '
cmd += ' ; /sbin/service network restart '
def run(self, params, args): hosts = self.getHostnames(args, managed_only=1)
cmd += ' ; "/sbin/service iptables start" ' cmd += '> /dev/null 2>&1'
cmd += ' ; /sbin/service iptables start ' cmd += '> /dev/null 2>&1" '
def run(self, params, args): hosts = self.getHostnames(args, managed_only=1)
sock.settimeout(2)
sock.settimeout(2.0)
def nodeup(self, host): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(2) try: # # this catches the case when the host is down # and/or there is no ssh daemon running # sock.connect((host, 22))
except socket.error:
except:
def nodeup(self, host): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(2) try: # # this catches the case when the host is down # and/or there is no ssh daemon running # sock.connect((host, 22))
(managed, x11, t, d, stats, collate, n) = \
(managed, x11, t, d, s, c, n) = \
def run(self, params, args): (args, command) = self.fillPositionalArgs(('command', ))
if self.str2bool(collate):
collate = self.str2bool(c) stats = self.str2bool(s) if collate:
def run(self, params, args): (args, command) = self.fillPositionalArgs(('command', ))
print '%s: down'
print '%s: down' % host numthreads += 1 work -= 1
def run(self, params, args): (args, command) = self.fillPositionalArgs(('command', ))
p = Parallel(self, cmd, host, self.str2bool(stats), self.str2bool(collate))
p = Parallel(self, cmd, host, stats, collate)
def run(self, params, args): (args, command) = self.fillPositionalArgs(('command', ))
if self.str2bool(collate):
if collate:
def run(self, params, args): (args, command) = self.fillPositionalArgs(('command', ))
self.addOutput('','\t\t\tfilename %s;' % filename)
self.addOutput('','\t\t\tfilename "%s";' % filename)
def printHost(self, name, hostname, mac, ip): self.addOutput('', '\t\thost %s {' % name) if mac: self.addOutput('', '\t\t\thardware ethernet %s;' % mac)
syslog.syslog(syslog.LOG_INFO, 'handle (file="%s" time="%.6f")' % (filename, time))
syslog.syslog(syslog.LOG_DEBUG, 'handle (file="%s" time="%.6f")' % (filename, time))
def run(self, url, sig):
syslog.syslog(syslog.LOG_INFO, 'dup (file="%s" time="%.6f")' % (filename, time))
syslog.syslog(syslog.LOG_DEBUG, 'dup (file="%s" time="%.6f")' % (filename, time))
def run(self, url, sig):
for h in self.db.fetchall():
for h, in self.db.fetchall():
def getHostnames(self, names=None, managed_only=0): """Expands the given list of names to valid cluster hostnames. A name can be a hostname, IP address, our group (membership name), or a MAC address. Any combination of these is valid. If the names list is empty a list of all hosts in the cluster is returned. The following groups are recognized: rackN - All non-frontend host in rack N appliancename - All appliances of a given type (e.g. compute) select ... - an SQL statement that returns a list of hosts
class IntArray:
class IntArray(_object):
def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
this = apply(_quickfix.new_IntArray, args)
this = _quickfix.new_IntArray(*args)
def __init__(self, *args): this = apply(_quickfix.new_IntArray, args) try: self.this.append(this) except: self.this = this
def __getitem__(*args): return apply(_quickfix.IntArray___getitem__, args) def __setitem__(*args): return apply(_quickfix.IntArray___setitem__, args) def cast(*args): return apply(_quickfix.IntArray_cast, args)
def __getitem__(*args): return _quickfix.IntArray___getitem__(*args) def __setitem__(*args): return _quickfix.IntArray___setitem__(*args) def cast(*args): return _quickfix.IntArray_cast(*args)
def __getitem__(*args): return apply(_quickfix.IntArray___getitem__, args)
this = apply(_quickfix.new_Exception, args)
this = _quickfix.new_Exception(*args)
def __init__(self, *args): this = apply(_quickfix.new_Exception, args) try: self.this.append(this) except: self.this = this
def __str__(*args): return apply(_quickfix.Exception___str__, args)
def __str__(*args): return _quickfix.Exception___str__(*args)
def __str__(*args): return apply(_quickfix.Exception___str__, args)
this = apply(_quickfix.new_DataDictionaryNotFound, args)
this = _quickfix.new_DataDictionaryNotFound(*args)
def __init__(self, *args): this = apply(_quickfix.new_DataDictionaryNotFound, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_FieldNotFound, args)
this = _quickfix.new_FieldNotFound(*args)
def __init__(self, *args): this = apply(_quickfix.new_FieldNotFound, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_FieldConvertError, args)
this = _quickfix.new_FieldConvertError(*args)
def __init__(self, *args): this = apply(_quickfix.new_FieldConvertError, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_MessageParseError, args)
this = _quickfix.new_MessageParseError(*args)
def __init__(self, *args): this = apply(_quickfix.new_MessageParseError, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_InvalidMessage, args)
this = _quickfix.new_InvalidMessage(*args)
def __init__(self, *args): this = apply(_quickfix.new_InvalidMessage, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_ConfigError, args)
this = _quickfix.new_ConfigError(*args)
def __init__(self, *args): this = apply(_quickfix.new_ConfigError, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_RuntimeError, args)
this = _quickfix.new_RuntimeError(*args)
def __init__(self, *args): this = apply(_quickfix.new_RuntimeError, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_InvalidTagNumber, args)
this = _quickfix.new_InvalidTagNumber(*args)
def __init__(self, *args): this = apply(_quickfix.new_InvalidTagNumber, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_RequiredTagMissing, args)
this = _quickfix.new_RequiredTagMissing(*args)
def __init__(self, *args): this = apply(_quickfix.new_RequiredTagMissing, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_TagNotDefinedForMessage, args)
this = _quickfix.new_TagNotDefinedForMessage(*args)
def __init__(self, *args): this = apply(_quickfix.new_TagNotDefinedForMessage, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_NoTagValue, args)
this = _quickfix.new_NoTagValue(*args)
def __init__(self, *args): this = apply(_quickfix.new_NoTagValue, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_IncorrectTagValue, args)
this = _quickfix.new_IncorrectTagValue(*args)
def __init__(self, *args): this = apply(_quickfix.new_IncorrectTagValue, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_IncorrectDataFormat, args)
this = _quickfix.new_IncorrectDataFormat(*args)
def __init__(self, *args): this = apply(_quickfix.new_IncorrectDataFormat, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_IncorrectMessageStructure, args)
this = _quickfix.new_IncorrectMessageStructure(*args)
def __init__(self, *args): this = apply(_quickfix.new_IncorrectMessageStructure, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_DuplicateFieldNumber, args)
this = _quickfix.new_DuplicateFieldNumber(*args)
def __init__(self, *args): this = apply(_quickfix.new_DuplicateFieldNumber, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_InvalidMessageType, args)
this = _quickfix.new_InvalidMessageType(*args)
def __init__(self, *args): this = apply(_quickfix.new_InvalidMessageType, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_UnsupportedMessageType, args)
this = _quickfix.new_UnsupportedMessageType(*args)
def __init__(self, *args): this = apply(_quickfix.new_UnsupportedMessageType, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_UnsupportedVersion, args)
this = _quickfix.new_UnsupportedVersion(*args)
def __init__(self, *args): this = apply(_quickfix.new_UnsupportedVersion, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_TagOutOfOrder, args)
this = _quickfix.new_TagOutOfOrder(*args)
def __init__(self, *args): this = apply(_quickfix.new_TagOutOfOrder, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_RepeatedTag, args)
this = _quickfix.new_RepeatedTag(*args)
def __init__(self, *args): this = apply(_quickfix.new_RepeatedTag, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_RepeatingGroupCountMismatch, args)
this = _quickfix.new_RepeatingGroupCountMismatch(*args)
def __init__(self, *args): this = apply(_quickfix.new_RepeatingGroupCountMismatch, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_DoNotSend, args)
this = _quickfix.new_DoNotSend(*args)
def __init__(self, *args): this = apply(_quickfix.new_DoNotSend, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_RejectLogon, args)
this = _quickfix.new_RejectLogon(*args)
def __init__(self, *args): this = apply(_quickfix.new_RejectLogon, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_SessionNotFound, args)
this = _quickfix.new_SessionNotFound(*args)
def __init__(self, *args): this = apply(_quickfix.new_SessionNotFound, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_IOException, args)
this = _quickfix.new_IOException(*args)
def __init__(self, *args): this = apply(_quickfix.new_IOException, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_SocketException, args) try: self.this.append(this) except: self.this = this def errorToWhat(*args): return apply(_quickfix.SocketException_errorToWhat, args)
this = _quickfix.new_SocketException(*args) try: self.this.append(this) except: self.this = this def errorToWhat(*args): return _quickfix.SocketException_errorToWhat(*args)
def __init__(self, *args): this = apply(_quickfix.new_SocketException, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_SocketSendFailed, args)
this = _quickfix.new_SocketSendFailed(*args)
def __init__(self, *args): this = apply(_quickfix.new_SocketSendFailed, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_SocketRecvFailed, args)
this = _quickfix.new_SocketRecvFailed(*args)
def __init__(self, *args): this = apply(_quickfix.new_SocketRecvFailed, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_SocketCloseFailed, args)
this = _quickfix.new_SocketCloseFailed(*args)
def __init__(self, *args): this = apply(_quickfix.new_SocketCloseFailed, args) try: self.this.append(this) except: self.this = this
class FieldBase:
class FieldBase(_object):
def __init__(self, *args): this = apply(_quickfix.new_SocketCloseFailed, args) try: self.this.append(this) except: self.this = this
this = apply(_quickfix.new_FieldBase, args)
this = _quickfix.new_FieldBase(*args)
def __init__(self, *args): this = apply(_quickfix.new_FieldBase, args) try: self.this.append(this) except: self.this = this
def setField(*args): return apply(_quickfix.FieldBase_setField, args) def setString(*args): return apply(_quickfix.FieldBase_setString, args) def getField(*args): return apply(_quickfix.FieldBase_getField, args) def getString(*args): return apply(_quickfix.FieldBase_getString, args) def getValue(*args): return apply(_quickfix.FieldBase_getValue, args) def getLength(*args): return apply(_quickfix.FieldBase_getLength, args) def getTotal(*args): return apply(_quickfix.FieldBase_getTotal, args) def __lt__(*args): return apply(_quickfix.FieldBase___lt__, args) def __str__(*args): return apply(_quickfix.FieldBase___str__, args)
def setField(*args): return _quickfix.FieldBase_setField(*args) def setString(*args): return _quickfix.FieldBase_setString(*args) def getField(*args): return _quickfix.FieldBase_getField(*args) def getString(*args): return _quickfix.FieldBase_getString(*args) def getValue(*args): return _quickfix.FieldBase_getValue(*args) def getLength(*args): return _quickfix.FieldBase_getLength(*args) def getTotal(*args): return _quickfix.FieldBase_getTotal(*args) def __lt__(*args): return _quickfix.FieldBase___lt__(*args) def __str__(*args): return _quickfix.FieldBase___str__(*args)
def setField(*args): return apply(_quickfix.FieldBase_setField, args)
this = apply(_quickfix.new_StringField, args) try: self.this.append(this) except: self.this = this def setValue(*args): return apply(_quickfix.StringField_setValue, args) def getValue(*args): return apply(_quickfix.StringField_getValue, args) def __lt__(*args): return apply(_quickfix.StringField___lt__, args) def __gt__(*args): return apply(_quickfix.StringField___gt__, args) def __eq__(*args): return apply(_quickfix.StringField___eq__, args) def __ne__(*args): return apply(_quickfix.StringField___ne__, args) def __le__(*args): return apply(_quickfix.StringField___le__, args) def __ge__(*args): return apply(_quickfix.StringField___ge__, args)
this = _quickfix.new_StringField(*args) try: self.this.append(this) except: self.this = this def setValue(*args): return _quickfix.StringField_setValue(*args) def getValue(*args): return _quickfix.StringField_getValue(*args) def __lt__(*args): return _quickfix.StringField___lt__(*args) def __gt__(*args): return _quickfix.StringField___gt__(*args) def __eq__(*args): return _quickfix.StringField___eq__(*args) def __ne__(*args): return _quickfix.StringField___ne__(*args) def __le__(*args): return _quickfix.StringField___le__(*args) def __ge__(*args): return _quickfix.StringField___ge__(*args)
def __init__(self, *args): this = apply(_quickfix.new_StringField, args) try: self.this.append(this) except: self.this = this