예제 #1
0
    def TimezoneSet(self, inTimezone):
        localtimeFile = '/etc/localtime'
        if os.path.isfile(localtimeFile):
            os.remove(localtimeFile)
        os.symlink(self.timezones.cities({})[inTimezone], localtimeFile)
        
        file = open('/etc/timezone', 'w')
        file.write(inTimezone+"\n")
        file.close()

        if os.path.exists('/etc/sysconfig/clock'):
            cfg = SimpleConfigFile()
            cfg.read('/etc/sysconfig/clock')
            cfg.info["ZONE"] = inTimezone
            cfg.write('/etc/sysconfig/clock')
예제 #2
0
    def TimezoneSet(self, inTimezone):
        localtimeFile = '/etc/localtime'
        if os.path.isfile(localtimeFile):
            os.remove(localtimeFile)
        os.symlink(self.timezones.cities({})[inTimezone], localtimeFile)

        file = open('/etc/timezone', 'w')
        file.write(inTimezone + "\n")
        file.close()

        if os.path.exists('/etc/sysconfig/clock'):
            cfg = SimpleConfigFile()
            cfg.read('/etc/sysconfig/clock')
            cfg.info["ZONE"] = inTimezone
            cfg.write('/etc/sysconfig/clock')
예제 #3
0
    def getDefaultTimeZone(self, instPath):
        try:
            return self.localeInfo[self.systemLang][4]
        except KeyError:
            # If doing an upgrade and the system language is something not
            # recognized by anaconda, we should try to see if we can figure
            # it out from the running system.
            if os.path.exists(instPath + "/etc/sysconfig/clock"):
                cfg = SimpleConfigFile()
                cfg.read(instPath + "/etc/sysconfig/clock")

                try:
                    return cfg.get("ZONE")
                except:
                    return self.localeInfo[self._default][4]
            else:
                return self.localeInfo[self._default][4]
예제 #4
0
    def getDefaultTimeZone(self, instPath):
        try:
            return self.localeInfo[self.systemLang][4]
        except KeyError:
            # If doing an upgrade and the system language is something not
            # recognized by anaconda, we should try to see if we can figure
            # it out from the running system.
            if os.path.exists(instPath + "/etc/sysconfig/clock"):
                cfg = SimpleConfigFile()
                cfg.read(instPath + "/etc/sysconfig/clock")

                try:
                    return cfg.get("ZONE")
                except:
                    return self.localeInfo[self._default][4]
            else:
                return self.localeInfo[self._default][4]
예제 #5
0
 def read(self, instPath = "/"):
     SimpleConfigFile.read(self, instPath + "/etc/sysconfig/keyboard")
     self.beenset = 1
예제 #6
0
 def read(self):
     self.reset()
     ifcfglog.debug("IfcfFile.read %s" % self.filename)
     SimpleConfigFile.read(self)
     self._dirty = False
예제 #7
0
 def read(self, instPath="/"):
     SimpleConfigFile.read(self, instPath + "/etc/sysconfig/keyboard")
     self.beenset = 1