(self)
Write the configuration back to file
Write the configuration back to file
Write the configuration back to file
def write(self):
        """Write the configuration back to file"""
        cf_old = self.cf_file + ".old"
        cf_new = self.cf_file + ".new"

        if self.walmgr.not_really:
            cf_new = "/tmp/postgresql.conf.new"
            open(cf_new, "w").write(self.cf_buf)
            self.log.info("Showing diff")
            os.system("diff -u %s %s" % (self.cf_file, cf_new))
            self.log.info("Done diff")
            os.remove(cf_new)
            return

        # polite method does not work, as usually not enough perms for it
        open(self.cf_file, "w").write(self.cf_buf)
def write ( self ) : cf_old = self . cf_file + ".old" cf_new = self . cf_file + ".new" if self . walmgr . not_really : cf_new = "/tmp/postgresql.conf.new" open ( cf_new , "w" ) . write ( self . cf_buf ) self . log . info ( "Showing diff" ) os . system ( "diff -u %s %s" % ( self . cf_file , cf_new ) ) self . log . info ( "Done diff" ) os . remove ( cf_new ) return # polite method does not work, as usually not enough perms for it open ( self . cf_file , "w" ) . write ( self . cf_buf )