Merge pull request #526 from Jmainguy/centos5_hostname
Fixed hostname for rhel5 python 2.4.3
This commit is contained in:
commit
07989f1f49
1 changed files with 20 additions and 18 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue