Merge pull request #526 from Jmainguy/centos5_hostname

Fixed hostname for rhel5 python 2.4.3
This commit is contained in:
Toshio Kuratomi 2014-12-16 13:35:51 -08:00
commit 07989f1f49

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]