Logo Search packages:      
Sourcecode: nagstamon version File versions  Download package

def Nagstamon::nagstamonConfig::Config::SaveConfig (   self  ) 

    save config file

Definition at line 182 of file nagstamonConfig.py.

00182                         :
        """
            save config file
        """
        try:
            # save config file with ConfigParser
            config = ConfigParser.ConfigParser()
            # general section for Nagstamon
            config.add_section("Nagstamon")
            for option in self.__dict__:
                if not option == "servers":
                    config.set("Nagstamon", option, self.__dict__[option])
            # one section for each configured server
            for server in self.__dict__["servers"]:
                config.add_section("Server_" + server)
                for option in self.__dict__["servers"][server].__dict__:
                    # obfuscate certain entries in config file
                    if option == "username" or option == "password" or option == "proxy_username" or option == "proxy_password":
                        config.set("Server_" + server, option, self.Obfuscate(self.__dict__["servers"][server].__dict__[option]))
                    else:
                        config.set("Server_" + server, option, self.__dict__["servers"][server].__dict__[option])
            # open, save and close config file
            f = open(os.path.normpath(self.configfile), "w")
            config.write(f)
            f.close()
            
        except:
            pass


    def Convert_Conf_to_Multiple_Servers(self):


Generated by  Doxygen 1.6.0   Back to index