mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 07:01:22 -07:00
Fixed hostname for rhel5 python 2.4.3
This commit is contained in:
parent
1d4808780f
commit
8c05023be3
1 changed files with 20 additions and 18 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue