Fixed hostname for rhel5 python 2.4.3

This commit is contained in:
Jonathan Mainguy 2014-12-16 09:49:13 -05:00
parent 54b836f0b8
commit 541070be4c

View file

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