Fixed hostname for rhel5 python 2.4.3

pull/18777/head
Jonathan Mainguy 10 years ago committed by Matt Clay
parent 1d4808780f
commit 8c05023be3

@ -285,6 +285,7 @@ class OpenRCStrategy(GenericStrategy):
HOSTNAME_FILE = '/etc/conf.d/hostname' HOSTNAME_FILE = '/etc/conf.d/hostname'
def get_permanent_hostname(self): def get_permanent_hostname(self):
try:
try: try:
f = open(self.HOSTNAME_FILE, 'r') f = open(self.HOSTNAME_FILE, 'r')
for line in f: for line in f:
@ -299,6 +300,7 @@ class OpenRCStrategy(GenericStrategy):
return None return None
def set_permanent_hostname(self, name): def set_permanent_hostname(self, name):
try:
try: try:
f = open(self.HOSTNAME_FILE, 'r') f = open(self.HOSTNAME_FILE, 'r')
lines = [x.strip() for x in f] lines = [x.strip() for x in f]

Loading…
Cancel
Save