def update_hostname(self):
        self.logIt("Copying hosts and hostname to final destination")
            
        if self.os_initdaemon == 'systemd':
            self.run(['/usr/bin/hostnamectl', 'set-hostname', self.hostname])
        else:
            if self.os_type in ['debian', 'ubuntu']:
                self.copyFile("%s/hostname" % self.outputFolder, self.etc_hostname)

            if self.os_type in ['centos', 'redhat', 'fedora']:
                self.copyFile("%s/network" % self.outputFolder, self.network)

            self.run(['/bin/hostname', self.hostname])

        self.copyFile("%s/hosts" % self.outputFolder, self.etc_hosts)
dataset/ETHPy150Open GluuFederation/community-edition-setup/setup.py/Setup.update_hostname/original