diff --git a/packages/google-compute-engine-oslogin/packaging/debian/changelog b/packages/google-compute-engine-oslogin/packaging/debian/changelog index bb4a1b54..5eb8a46a 100644 --- a/packages/google-compute-engine-oslogin/packaging/debian/changelog +++ b/packages/google-compute-engine-oslogin/packaging/debian/changelog @@ -1,3 +1,9 @@ +google-compute-engine-oslogin (1:20190801.00-g1) stable; urgency=medium + + * Correct JSON refcount decrementing. + + -- Google Cloud Team Thu, 01 Aug 2019 13:57:16 -0700 + google-compute-engine-oslogin (1:20190729.00-g1) stable; urgency=medium * Remove unnecessary binary search logic. diff --git a/packages/google-compute-engine-oslogin/packaging/setup_deb.sh b/packages/google-compute-engine-oslogin/packaging/setup_deb.sh index d9de78c0..5b3f8931 100755 --- a/packages/google-compute-engine-oslogin/packaging/setup_deb.sh +++ b/packages/google-compute-engine-oslogin/packaging/setup_deb.sh @@ -14,7 +14,7 @@ # limitations under the License. NAME="google-compute-engine-oslogin" -VERSION="20190729.00" +VERSION="20190801.00" DEB=$(cut -d. -f1 Thu, 01 Aug 2019 14:06:02 -0700 + google-compute-engine (1:20190729.00-g1) stable; urgency=medium * Suport Google Private Access over IPv6. diff --git a/packages/google-compute-engine/packaging/setup_deb.sh b/packages/google-compute-engine/packaging/setup_deb.sh index d4c84e9c..42ef2667 100755 --- a/packages/google-compute-engine/packaging/setup_deb.sh +++ b/packages/google-compute-engine/packaging/setup_deb.sh @@ -14,7 +14,7 @@ # limitations under the License. NAME="google-compute-engine" -VERSION="20190729.00" +VERSION="20190801.00" working_dir=${PWD} if [[ $(basename "$working_dir") != $NAME ]]; then diff --git a/packages/google-compute-engine/packaging/setup_rpm.sh b/packages/google-compute-engine/packaging/setup_rpm.sh index 119caaab..42e9c15f 100755 --- a/packages/google-compute-engine/packaging/setup_rpm.sh +++ b/packages/google-compute-engine/packaging/setup_rpm.sh @@ -14,7 +14,7 @@ # limitations under the License. NAME="google-compute-engine" -VERSION="20190729.00" +VERSION="20190801.00" rpm_working_dir=/tmp/rpmpackage/${NAME}-${VERSION} working_dir=${PWD} diff --git a/packages/python-google-compute-engine/google_compute_engine/boto/boto_config.py b/packages/python-google-compute-engine/google_compute_engine/boto/boto_config.py index 6771c5cc..2c92d9df 100644 --- a/packages/python-google-compute-engine/google_compute_engine/boto/boto_config.py +++ b/packages/python-google-compute-engine/google_compute_engine/boto/boto_config.py @@ -35,6 +35,10 @@ class BotoConfig(object): """Creates a boto config file for standalone GSUtil.""" + # WARNING: The path should remain as /etc/boto.cfg in order to not break + # tools, such as gsutil, that rely on loading well-known Boto config paths. + # If you want to change this, please consult the gsutil team + # (GoogleCloudPlatform/gsutil) first. boto_config = constants.BOTOCONFDIR + '/etc/boto.cfg' boto_config_template = constants.BOTOCONFDIR + '/etc/boto.cfg.template' boto_config_script = os.path.abspath(__file__) @@ -80,10 +84,10 @@ def _CreateConfig(self, project_id): config = config_manager.ConfigManager( config_file=self.boto_config_template, config_header=self.boto_config_header) - boto_dir = os.path.dirname(self.boto_config_script) + # WARNING: If you want to change the contents of this config file, please + # consult the gsutil team (GoogleCloudPlatform/gsutil) first. config.SetOption('GSUtil', 'default_project_id', project_id) config.SetOption('GSUtil', 'default_api_version', '2') config.SetOption('GoogleCompute', 'service_account', 'default') - config.SetOption('Plugin', 'plugin_directory', boto_dir) config.WriteConfig(config_file=self.boto_config) diff --git a/packages/python-google-compute-engine/google_compute_engine/boto/tests/boto_config_test.py b/packages/python-google-compute-engine/google_compute_engine/boto/tests/boto_config_test.py index 3ba4168c..bc2c05a1 100644 --- a/packages/python-google-compute-engine/google_compute_engine/boto/tests/boto_config_test.py +++ b/packages/python-google-compute-engine/google_compute_engine/boto/tests/boto_config_test.py @@ -53,7 +53,6 @@ def testCreateConfig(self, mock_config, mock_logger, mock_watcher): mock.call.set('GSUtil', 'default_project_id', self.project_id), mock.call.set('GSUtil', 'default_api_version', '2'), mock.call.set('GoogleCompute', 'service_account', 'default'), - mock.call.set('Plugin', 'plugin_directory', '/tmp'), mock.call.write(config_file='config'), ] self.assertEqual(mocks.mock_calls, expected_calls) diff --git a/packages/python-google-compute-engine/google_compute_engine/constants.py b/packages/python-google-compute-engine/google_compute_engine/constants.py index d929baf8..cfe87c49 100644 --- a/packages/python-google-compute-engine/google_compute_engine/constants.py +++ b/packages/python-google-compute-engine/google_compute_engine/constants.py @@ -16,7 +16,6 @@ """A module for global constants.""" import platform -import sys OSLOGIN_CONTROL_SCRIPT = 'google_oslogin_control' OSLOGIN_NSS_CACHE_SCRIPT = 'google_oslogin_nss_cache' @@ -42,8 +41,3 @@ OSLOGIN_NSS_CACHE = '/etc/oslogin_passwd.cache' SYSCONFDIR = '/etc/default' SYSLOG_SOCKET = '/dev/log' - -if sys.version_info >= (3, 0): - SET_BOTO_CONFIG = 'false' -else: - SET_BOTO_CONFIG = 'true' diff --git a/packages/python-google-compute-engine/google_compute_engine/instance_setup/instance_config.py b/packages/python-google-compute-engine/google_compute_engine/instance_setup/instance_config.py index 23261152..8f2fadf1 100644 --- a/packages/python-google-compute-engine/google_compute_engine/instance_setup/instance_config.py +++ b/packages/python-google-compute-engine/google_compute_engine/instance_setup/instance_config.py @@ -78,7 +78,9 @@ class InstanceConfig(config_manager.ConfigManager): 'host_key_types': 'ecdsa,ed25519,rsa', 'optimize_local_ssd': 'true', 'network_enabled': 'true', - 'set_boto_config': constants.SET_BOTO_CONFIG, + # WARNING: Do not change the value of 'set_boto_config' without first + # consulting the gsutil team (GoogleCloudPlatform/gsutil). + 'set_boto_config': 'true', 'set_host_keys': 'true', 'set_multiqueue': 'true', }, diff --git a/packages/python-google-compute-engine/google_compute_engine/metadata_scripts/script_retriever.py b/packages/python-google-compute-engine/google_compute_engine/metadata_scripts/script_retriever.py index c880f49a..3de425b6 100644 --- a/packages/python-google-compute-engine/google_compute_engine/metadata_scripts/script_retriever.py +++ b/packages/python-google-compute-engine/google_compute_engine/metadata_scripts/script_retriever.py @@ -112,12 +112,12 @@ def _DownloadAuthUrl(self, url, dest_dir): request = urlrequest.Request(url) request.add_unredirected_header('Metadata-Flavor', 'Google') request.add_unredirected_header('Authorization', self.token) - content = _UrlOpenWithRetry(request).read().decode('utf-8') + content = _UrlOpenWithRetry(request).read() except Exception as e: self.logger.warning('Could not download %s. %s.', url, str(e)) return None - with open(dest, 'w') as f: + with open(dest, 'wb') as f: f.write(content) return dest diff --git a/packages/python-google-compute-engine/google_compute_engine/metadata_scripts/tests/script_retriever_test.py b/packages/python-google-compute-engine/google_compute_engine/metadata_scripts/tests/script_retriever_test.py index b9d9d1b2..0df8830f 100644 --- a/packages/python-google-compute-engine/google_compute_engine/metadata_scripts/tests/script_retriever_test.py +++ b/packages/python-google-compute-engine/google_compute_engine/metadata_scripts/tests/script_retriever_test.py @@ -59,10 +59,10 @@ def testDownloadAuthUrl(self, mock_urlopen, mock_request, mock_tempfile): mocked_request.add_unredirected_header.assert_called_with( 'Authorization', 'bar') mock_urlopen.assert_called_with(mocked_request) - urlopen_read = mock_urlopen().read(return_value=b'foo').decode() + urlopen_read = mock_urlopen().read(return_value=b'foo') self.mock_logger.warning.assert_not_called() - mock_open.assert_called_once_with(self.dest, 'w') + mock_open.assert_called_once_with(self.dest, 'wb') handle = mock_open() handle.write.assert_called_once_with(urlopen_read) diff --git a/packages/python-google-compute-engine/packaging/debian/changelog b/packages/python-google-compute-engine/packaging/debian/changelog index e919d55c..d1696408 100644 --- a/packages/python-google-compute-engine/packaging/debian/changelog +++ b/packages/python-google-compute-engine/packaging/debian/changelog @@ -1,3 +1,10 @@ +python-google-compute-engine (1:20190801.00-g1) stable; urgency=medium + + * Re-enable boto config and drop writing plugin directory. + * Fix metadata script retrieval. + + -- Google Cloud Team Thu, 01 Aug 2019 13:55:46 -0700 + python-google-compute-engine (1:20190729.00-g1) stable; urgency=medium * Support for Google Private Access over IPv6. diff --git a/packages/python-google-compute-engine/packaging/setup_deb.sh b/packages/python-google-compute-engine/packaging/setup_deb.sh index 573dba4a..9dc83065 100755 --- a/packages/python-google-compute-engine/packaging/setup_deb.sh +++ b/packages/python-google-compute-engine/packaging/setup_deb.sh @@ -14,7 +14,7 @@ # limitations under the License. NAME="python-google-compute-engine" -VERSION="20190729.00" +VERSION="20190801.00" working_dir=${PWD} if [[ $(basename "$working_dir") != $NAME ]]; then diff --git a/packages/python-google-compute-engine/packaging/setup_rpm.sh b/packages/python-google-compute-engine/packaging/setup_rpm.sh index e12be10f..f9266734 100755 --- a/packages/python-google-compute-engine/packaging/setup_rpm.sh +++ b/packages/python-google-compute-engine/packaging/setup_rpm.sh @@ -14,7 +14,7 @@ # limitations under the License. NAME="python-google-compute-engine" -VERSION="20190729.00" +VERSION="20190801.00" rpm_working_dir=/tmp/rpmpackage/${NAME}-${VERSION} working_dir=${PWD} diff --git a/packages/python-google-compute-engine/setup.py b/packages/python-google-compute-engine/setup.py index a4fee36d..c51b5ffb 100755 --- a/packages/python-google-compute-engine/setup.py +++ b/packages/python-google-compute-engine/setup.py @@ -37,7 +37,7 @@ name='google-compute-engine', packages=setuptools.find_packages(), url='https://github.com/GoogleCloudPlatform/compute-image-packages', - version='20190729.00', + version='20190801.00', # Entry points create scripts in /usr/bin that call a function. entry_points={ 'console_scripts': [