diff --git a/CHANGES.txt b/CHANGES.txt index 4ecebfd8cf..ad36843a65 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -26,6 +26,7 @@ Merged from 3.0: * NullPointerExpception when reading/compacting table (CASSANDRA-11988) * Fix problem with undeleteable rows on upgrade to new sstable format (CASSANDRA-12144) Merged from 2.2: + * cqlsh copyutil should get host metadata by connected address (CASSANDRA-11979) * Fixed cqlshlib.test.remove_test_db (CASSANDRA-12214) Merged from 2.1: * cannot use cql since upgrading python to 2.7.11+ (CASSANDRA-11850) diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py index 768a41a081..d0524fe85d 100644 --- a/pylib/cqlshlib/copyutil.py +++ b/pylib/cqlshlib/copyutil.py @@ -205,7 +205,7 @@ class CopyTask(object): self.ks = ks self.table = table self.table_meta = self.shell.get_table_meta(self.ks, self.table) - self.local_dc = shell.conn.metadata.get_host(shell.hostname).datacenter + self.host = shell.conn.get_control_connection_host() self.fname = safe_normpath(fname) self.protocol_version = protocol_version self.config_file = config_file @@ -447,11 +447,11 @@ class CopyTask(object): return dict(ks=self.ks, table=self.table, - local_dc=self.local_dc, + local_dc=self.host.datacenter, columns=self.columns, options=self.options, connect_timeout=shell.conn.connect_timeout, - hostname=shell.hostname, + hostname=self.host.address, port=shell.port, ssl=shell.ssl, auth_provider=shell.auth_provider, @@ -646,8 +646,8 @@ class ExportTask(CopyTask): we use the cqlsh session host. """ shell = self.shell - hostname = shell.hostname - local_dc = self.local_dc + hostname = self.host.address + local_dc = self.host.datacenter ranges = dict() min_token = self.get_min_token() begin_token = self.begin_token