Skip to content

Commit

Permalink
Use ConfigParser instead of SafeConfigParser
Browse files Browse the repository at this point in the history
  • Loading branch information
tkopecek committed Jan 17, 2024
1 parent 176f6e0 commit 24aef63
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions imagefactory_plugins/EC2/EC2.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self):
self.log = logging.getLogger('%s.%s' % (__name__, self.__class__.__name__))
config_obj = ApplicationConfiguration()
self.app_config = config_obj.configuration
self.oz_config = configparser.SafeConfigParser()
self.oz_config = configparser.ConfigParser()
self.oz_config.read("/etc/oz/oz.cfg")
self.oz_config.set('paths', 'output_dir', self.app_config["imgdir"])
self.guest = None
Expand Down Expand Up @@ -118,7 +118,7 @@ def builder_did_create_target_image(self, builder, target, image_id, template, p

# populate a config object to pass to OZ; this allows us to specify our
# own output dir but inherit other Oz behavior
self.oz_config = configparser.SafeConfigParser()
self.oz_config = configparser.ConfigParser()
self.oz_config.read("/etc/oz/oz.cfg")
self.oz_config.set('paths', 'output_dir', self.app_config["imgdir"])

Expand Down
2 changes: 1 addition & 1 deletion imagefactory_plugins/IndirectionCloud/IndirectionCloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def oz_refresh_customizations(self, partial_tdl):
def _init_oz(self):
# populate a config object to pass to OZ; this allows us to specify our
# own output dir but inherit other Oz behavior
self.oz_config = configparser.SafeConfigParser()
self.oz_config = configparser.ConfigParser()
if self.oz_config.read("/etc/oz/oz.cfg") != []:
self.oz_config.set('paths', 'output_dir', self.app_config["imgdir"])
if "oz_data_dir" in self.app_config:
Expand Down
4 changes: 2 additions & 2 deletions imagefactory_plugins/Nova/Nova.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from time import sleep
from base64 import b64decode
#TODO: remove dependency on Oz
from configparser import SafeConfigParser
from configparser import ConfigParser
from oz.TDL import TDL
import oz.GuestFactory

Expand Down Expand Up @@ -438,7 +438,7 @@ def _confirm_ssh_access(self, guest, addr, timeout=300):
return confirmation

def _oz_config(self, private_key_file):
config = SafeConfigParser()
config = ConfigParser()
if config.read("/etc/oz/oz.cfg"):
config.set('paths', 'output_dir', self.app_config['imgdir'])
config.set('paths', 'sshprivkey', private_key_file)
Expand Down
2 changes: 1 addition & 1 deletion imagefactory_plugins/Rackspace/Rackspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self):
self.log = logging.getLogger('%s.%s' % (__name__, self.__class__.__name__))
config_obj = ApplicationConfiguration()
self.app_config = config_obj.configuration
self.oz_config = configparser.SafeConfigParser()
self.oz_config = configparser.ConfigParser()
self.oz_config.read("/etc/oz/oz.cfg")
self.oz_config.set('paths', 'output_dir', self.app_config["imgdir"])
self.active_image = None
Expand Down
2 changes: 1 addition & 1 deletion imagefactory_plugins/TinMan/TinMan.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def _init_oz(self):

# populate a config object to pass to OZ; this allows us to specify our
# own output dir but inherit other Oz behavior
self.oz_config = configparser.SafeConfigParser()
self.oz_config = configparser.ConfigParser()
if self.oz_config.read("/etc/oz/oz.cfg") != []:
if self.parameters.get("oz_overrides", None) != None:
oz_overrides = json.loads(self.parameters.get("oz_overrides",None).replace("'", "\""))
Expand Down

0 comments on commit 24aef63

Please sign in to comment.