Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions agent/bindir/cloud-setup-agent.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ import os
import logging
import sys
import socket

# ---- This snippet of code adds the sources path and the waf configured PYTHONDIR to the Python path ----
# ---- We do this so cloud_utils can be looked up in the following order:
# ---- 1) Sources directory
# ---- 2) waf configured PYTHONDIR
# ---- 3) System Python path
for pythonpath in (
"@PYTHONDIR@",
os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"python","lib"),
):
if os.path.isdir(pythonpath): sys.path.insert(0,pythonpath)
# ---- End snippet of code ----

from cloudutils.cloudException import CloudRuntimeException, CloudInternalException
from cloudutils.utilities import initLoging, bash
from cloudutils.configFileOps import configFileOps
Expand Down
13 changes: 13 additions & 0 deletions agent/bindir/libvirtqemuhook.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ import sys
import os
import subprocess
from threading import Timer

# ---- This snippet of code adds the sources path and the waf configured PYTHONDIR to the Python path ----
# ---- We do this so cloud_utils can be looked up in the following order:
# ---- 1) Sources directory
# ---- 2) waf configured PYTHONDIR
# ---- 3) System Python path
for pythonpath in (
"@PYTHONDIR@",
os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"python","lib"),
):
if os.path.isdir(pythonpath): sys.path.insert(0,pythonpath)
# ---- End snippet of code ----

from xml.dom.minidom import parse
from cloudutils.configFileOps import configFileOps
from cloudutils.networkConfig import networkConfig
Expand Down
14 changes: 14 additions & 0 deletions client/bindir/cloud-setup-management.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,27 @@
# specific language governing permissions and limitations
# under the License.

import os
import sys
# ---- This snippet of code adds the sources path and the waf configured PYTHONDIR to the Python path ----
# ---- We do this so cloud_utils can be looked up in the following order:
# ---- 1) Sources directory
# ---- 2) waf configured PYTHONDIR
# ---- 3) System Python path
for pythonpath in (
"@PYTHONDIR@",
os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"python","lib"),
):
if os.path.isdir(pythonpath): sys.path.insert(0,pythonpath)
# ---- End snippet of code ----

from cloudutils.syscfg import sysConfigFactory
from cloudutils.utilities import initLoging, UnknownSystemException
from cloudutils.cloudException import CloudRuntimeException, CloudInternalException
from cloudutils.globalEnv import globalEnv
from cloudutils.serviceConfigServer import cloudManagementConfig
from optparse import OptionParser

if __name__ == '__main__':
initLoging("@MSLOGDIR@/setupManagement.log")
glbEnv = globalEnv()
Expand Down
7 changes: 4 additions & 3 deletions python/lib/cloudutils/syscfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def getAgent(glbEnv):
return sysConfigAgentUbuntu(glbEnv)
elif distribution == "CentOS" or distribution == "RHEL5":
return sysConfigEL5(glbEnv)
elif distribution == "Fedora" or distribution == "RHEL6":
elif distribution == "RHEL6":
return sysConfigEL6(glbEnv)
elif distribution == "RHEL7":
return sysConfigEL7(glbEnv)
elif distribution in ["RHEL8", "RHEL9"]:
elif distribution in ["Fedora", "RHEL8", "RHEL9", "RHEL10"]:
return sysConfigEL(glbEnv)
elif distribution == "SUSE":
return sysConfigSUSE(glbEnv)
Expand Down Expand Up @@ -183,9 +183,10 @@ def __init__(self, glbEnv):
networkConfigRedhat(self),
libvirtConfigRedhat(self),
firewallConfigAgent(self),
nfsConfig(self),
cloudAgentConfig(self)]

#it covers RHEL6/Fedora13/Fedora14
#it covers RHEL6
class sysConfigEL6(sysConfigAgentRedhatBase):
def __init__(self, glbEnv):
super(sysConfigEL6, self).__init__(glbEnv)
Expand Down
4 changes: 4 additions & 0 deletions python/lib/cloudutils/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ def __init__(self):
version.find("Red Hat Enterprise Linux release 9") != -1 or version.find("Linux release 9.") != -1 or
version.find("Linux release 9") != -1):
self.distro = "RHEL9"
elif (version.find("Red Hat Enterprise Linux Server release 10") != -1 or version.find("Scientific Linux release 10") != -1 or
version.find("Red Hat Enterprise Linux release 10") != -1 or version.find("Linux release 10.") != -1 or
version.find("Linux release 10") != -1):
self.distro = "RHEL10"
elif version.find("CentOS") != -1:
self.distro = "CentOS"
else:
Expand Down