summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:48:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:48:59 +0000
commitd835b2cae8abc71958b69362162e6a70c3d7ef63 (patch)
tree81052e3d2ce3e1bcda085f73d925e9d6257dec15 /bin
parentInitial commit. (diff)
downloadcrmsh-d835b2cae8abc71958b69362162e6a70c3d7ef63.tar.xz
crmsh-d835b2cae8abc71958b69362162e6a70c3d7ef63.zip
Adding upstream version 4.6.0.upstream/4.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/crm56
1 files changed, 56 insertions, 0 deletions
diff --git a/bin/crm b/bin/crm
new file mode 100755
index 0000000..6fe74d8
--- /dev/null
+++ b/bin/crm
@@ -0,0 +1,56 @@
+#!/usr/bin/python3
+#
+# crmsh, command line interface for Linux HA clusters
+# Copyright (C) 2008-2015 Dejan Muhamedagic <dmuhamedagic@suse.de>
+# Copyright (C) 2013-2015 Kristoffer Gronlund <kgronlund@suse.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import sys
+
+if int(sys.version[0]) < 3:
+ sys.stderr.write("Abort: crmsh only support python3\n")
+ sys.exit(-1)
+
+try:
+ from crmsh import log
+ if '-h' not in sys.argv and '--help' not in sys.argv:
+ log.setup_logging()
+ else:
+ log.setup_logging(only_help=True)
+
+ from crmsh import main
+except ImportError as msg:
+ sys.stderr.write('''Fatal error:
+ %s
+
+Failed to start crmsh! This is likely due to:
+- A missing dependency (eg. corresponding python3 version)
+- A broken installation
+
+If you are using a packaged version of crmsh, please try
+reinstalling the package. Also check your PYTHONPATH and
+make sure that the crmsh module is reachable.
+
+Please file an issue describing your installation at
+https://github.com/Clusterlabs/crmsh/issues/ .
+''' % (msg))
+ sys.exit(-1)
+
+rc = main.run()
+sys.exit(rc)
+
+# vim:ts=4:sw=4:et: