Fixed hostname for rhel5 python 2.4.3

This commit is contained in:
Jonathan Mainguy 2014-12-16 09:49:13 -05:00 committed by Matt Clay
commit 8c05023be3

View file

@ -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]