Skip to content

Commit 931acda

Browse files
committed
Dev: ui_cluster: Remove unused codes
1 parent cf3b3f3 commit 931acda

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

crmsh/bootstrap.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def my_hostname_resolves():
595595
return False
596596

597597

598-
def check_prereqs(stage):
598+
def check_prereqs():
599599
warned = False
600600

601601
if not my_hostname_resolves():
@@ -2152,14 +2152,8 @@ def bootstrap_init(context):
21522152
# Need hostname resolution to work, want NTP (but don't block csync2_remote)
21532153
if stage not in ('csync2_remote', 'qnetd_remote'):
21542154
check_tty()
2155-
if not check_prereqs(stage):
2155+
if not check_prereqs():
21562156
return
2157-
else:
2158-
args = _context.args
2159-
logger_utils.log_only_to_file("args: {}".format(args))
2160-
if len(args) != 2:
2161-
utils.fatal(f"Expected NODE argument to {stage} stage")
2162-
_context.cluster_node = args[1]
21632157

21642158
if stage and _context.cluster_is_running and \
21652159
not ServiceManager(shell=sh.ClusterShellAdaptorForLocalShell(sh.LocalShell())).service_is_active(CSYNC2_SERVICE):
@@ -2245,7 +2239,7 @@ def bootstrap_join(context):
22452239

22462240
check_tty()
22472241

2248-
if not check_prereqs("join"):
2242+
if not check_prereqs():
22492243
return
22502244

22512245
if _context.stage != "":

crmsh/ui_cluster.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,6 @@ def do_init(self, context, *args):
329329
'''
330330
Initialize a cluster.
331331
'''
332-
def looks_like_hostnames(lst):
333-
sectionlist = bootstrap.INIT_STAGES
334-
return all(not (l.startswith('-') or l in sectionlist) for l in lst)
335-
if len(args) > 0:
336-
if '--dry-run' in args or looks_like_hostnames(args):
337-
args = ['--yes', '--nodes'] + [arg for arg in args if arg != '--dry-run']
338332
parser = ArgumentParser(description="""
339333
Initialize a cluster from scratch. This command configures
340334
a complete cluster, and can also add additional cluster

0 commit comments

Comments
 (0)