summaryrefslogtreecommitdiffstats
path: root/utils/src
diff options
context:
space:
mode:
Diffstat (limited to 'utils/src')
-rw-r--r--utils/src/ooinstall/ansible_plugins/facts_callback.py7
-rw-r--r--utils/src/ooinstall/cli_installer.py20
-rw-r--r--utils/src/ooinstall/oo_config.py17
3 files changed, 7 insertions, 37 deletions
diff --git a/utils/src/ooinstall/ansible_plugins/facts_callback.py b/utils/src/ooinstall/ansible_plugins/facts_callback.py
index e51890a22..c881e4b92 100644
--- a/utils/src/ooinstall/ansible_plugins/facts_callback.py
+++ b/utils/src/ooinstall/ansible_plugins/facts_callback.py
@@ -5,6 +5,7 @@
import os
import yaml
from ansible.plugins.callback import CallbackBase
+from ansible.parsing.yaml.dumper import AnsibleDumper
# pylint: disable=super-init-not-called
@@ -38,7 +39,11 @@ class CallbackModule(CallbackBase):
facts = abridged_result['result']['ansible_facts']['openshift']
hosts_yaml = {}
hosts_yaml[res._host.get_name()] = facts
- os.write(self.hosts_yaml, yaml.safe_dump(hosts_yaml))
+ to_dump = yaml.dump(hosts_yaml,
+ allow_unicode=True,
+ default_flow_style=False,
+ Dumper=AnsibleDumper)
+ os.write(self.hosts_yaml, to_dump)
def v2_runner_on_skipped(self, res):
pass
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py
index b787741d7..a6d784dea 100644
--- a/utils/src/ooinstall/cli_installer.py
+++ b/utils/src/ooinstall/cli_installer.py
@@ -72,12 +72,6 @@ You might want to override the default subdomain used for exposed routes. If you
return click.prompt('New default subdomain (ENTER for none)', default='')
-def list_hosts(hosts):
- hosts_idx = range(len(hosts))
- for idx in hosts_idx:
- click.echo(' {}: {}'.format(idx, hosts[idx]))
-
-
def collect_hosts(oo_cfg, existing_env=False, masters_set=False, print_summary=True):
"""
Collect host information from user. This will later be filled in using
@@ -656,20 +650,6 @@ https://docs.openshift.com/enterprise/latest/admin_guide/install/prerequisites.h
return oo_cfg
-def get_role_variable(oo_cfg, role_name, variable_name):
- try:
- target_role = next(role for role in oo_cfg.deployment.roles if role.name is role_name)
- target_variable = target_role.variables[variable_name]
- return target_variable
- except (StopIteration, KeyError):
- return None
-
-
-def set_role_variable(oo_cfg, role_name, variable_name, variable_value):
- target_role = next(role for role in oo_cfg.deployment.roles if role.name is role_name)
- target_role[variable_name] = variable_value
-
-
def collect_new_nodes(oo_cfg):
click.clear()
click.echo('*** New Node Configuration ***')
diff --git a/utils/src/ooinstall/oo_config.py b/utils/src/ooinstall/oo_config.py
index cf14105af..c3501c018 100644
--- a/utils/src/ooinstall/oo_config.py
+++ b/utils/src/ooinstall/oo_config.py
@@ -126,15 +126,6 @@ class Host(object):
""" Does this host have the etcd role """
return 'etcd' in self.roles
- def is_etcd_member(self, all_hosts):
- """ Will this host be a member of a standalone etcd cluster. """
- if not self.is_master():
- return False
- masters = [host for host in all_hosts if host.is_master()]
- if len(masters) > 1:
- return True
- return False
-
def is_dedicated_node(self):
""" Will this host be a dedicated node. (not a master) """
return self.is_node() and not self.is_master()
@@ -185,7 +176,7 @@ class Deployment(object):
class OOConfig(object):
default_dir = os.path.normpath(
os.environ.get('XDG_CONFIG_HOME',
- os.environ['HOME'] + '/.config/') + '/openshift/')
+ os.environ.get('HOME', '') + '/.config/') + '/openshift/')
default_file = '/installer.cfg.yml'
def __init__(self, config_path):
@@ -436,12 +427,6 @@ class OOConfig(object):
def __str__(self):
return self.yaml()
- def get_host(self, name):
- for host in self.deployment.hosts:
- if host.connect_to == name:
- return host
- return None
-
def get_host_roles_set(self):
roles_set = set()
for host in self.deployment.hosts: