Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ConfigParser instead of SafeConfigParser #457

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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