From b25ddd8a7f470fbe2e34f6a16549c03e093ea1f9 Mon Sep 17 00:00:00 2001 From: Mihai Suteu Date: Thu, 19 Jun 2014 15:14:54 +1100 Subject: [PATCH] cqlsh: ignore .cassandra permission errors patch by Mihai Suteu; reviewed by Mikhail Stepura for CASSANDRA-7266 --- CHANGES.txt | 1 + bin/cqlsh | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index a64551681220..8da8258489eb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 1.2.17 + * cqlsh: ignore .cassandra permission errors (CASSANDRA-7266) * Errors in FlushRunnable may leave threads hung (CASSANDRA-7275) * reduce failure detector initial value to 2s (CASSANDRA-7307) * Fix problem truncating on a node that was previously in a dead state (CASSANDRA-7318) diff --git a/bin/cqlsh b/bin/cqlsh index 24cb3b8bf414..cec9aac5f90d 100755 --- a/bin/cqlsh +++ b/bin/cqlsh @@ -122,7 +122,10 @@ HISTORY_DIR = os.path.expanduser(os.path.join('~', '.cassandra')) CONFIG_FILE = os.path.join(HISTORY_DIR, 'cqlshrc') HISTORY = os.path.join(HISTORY_DIR, 'cqlsh_history') if not os.path.exists(HISTORY_DIR): - os.mkdir(HISTORY_DIR) + try: + os.mkdir(HISTORY_DIR) + except OSError: + print '\nWarning: Cannot create directory at `%s`. Command history will not be saved.\n' % HISTORY_DIR OLD_CONFIG_FILE = os.path.expanduser(os.path.join('~', '.cqlshrc')) if os.path.exists(OLD_CONFIG_FILE):