Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
zmarano committed May 22, 2019
2 parents d2d5925 + 6f53f95 commit 14f700e
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/google-compute-engine-oslogin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BASENAME = oslogin
NAME = google-compute-engine-$(BASENAME)
MAJOR = 1
MINOR = 5
REVISION = 2
REVISION = 3

LIBNSS_CACHE_OSLOGIN = libnss_cache_$(BASENAME)
LIBNSS_CACHE_OSLOGIN_NAME = libnss_cache_$(NAME)-$(MAJOR).$(MINOR).$(REVISION).so
Expand Down
17 changes: 10 additions & 7 deletions packages/google-compute-engine-oslogin/bin/google_oslogin_control
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.

is_freebsd() {
[ "$(uname)" = "FreeBSD" ]
return $?
}

nss_config="/etc/nsswitch.conf"
pam_sshd_config="/etc/pam.d/sshd"
pam_su_config="/etc/pam.d/su"
sshd_config="/etc/ssh/sshd_config"
group_config="/etc/security/group.conf"
sudoers_dir="/var/google-sudoers.d"
users_dir="/var/google-users.d"
sudoers_file="/etc/sudoers.d/google-oslogin"
added_comment="# Added by Google Compute Engine OS Login."
sshd_block="#### Google OS Login control. Do not edit this section. ####"
sshd_end_block="#### End Google OS Login control section. ####"

is_freebsd() {
[ "$(uname)" = "FreeBSD" ]
return $?
}
sudoers_file="/etc/sudoers.d/google-oslogin"
if is_freebsd; then
sudoers_file="/usr/local/etc/sudoers.d/google-oslogin"
fi

# Update nsswitch.conf to include OS Login NSS module for passwd.
modify_nsswitch_conf() {
Expand Down Expand Up @@ -97,7 +100,7 @@ modify_sshd_conf() (
if ! grep -q "$sshd_block" "$sshd_config"; then
# Remove old-style additions.
$sed -i"" "/${added_comment}/,+1d" "$sshd_config"
/bin/echo -e "\n\n${sshd_block}\n${sshd_end_block}" >> "$sshd_config"
printf "\n\n${sshd_block}\n${sshd_end_block}" >> "$sshd_config"
fi

for entry in "$sshd_auth_keys_command" "$sshd_auth_keys_command_user"; do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
google-compute-engine-oslogin (1.5.3-1) unstable; urgency=low

* Update OS Login control file for FreeBSD support.

-- Google Cloud Team <[email protected]> Tue, 22 Nay 2019 12:00:00 -0700

google-compute-engine-oslogin (1.5.2-1) unstable; urgency=low

* Fix pam_group ordering detection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

NAME="google-compute-engine-oslogin"
VERSION="1.5.2"
VERSION="1.5.3"

working_dir=${PWD}
if [[ $(basename "$working_dir") != $NAME ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


NAME="google-compute-engine-oslogin"
VERSION="1.5.2"
VERSION="1.5.3"

rpm_working_dir=/tmp/rpmpackage/${NAME}-${VERSION}
working_dir=${PWD}
Expand Down
6 changes: 6 additions & 0 deletions packages/google-compute-engine/packaging/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
google-compute-engine (2.8.16-1) stable; urgency=low

* Fix instance setup in Python 3 environments.

-- Google Cloud Team <[email protected]> Tue, 22 May 2019 12:00:00 -0700

google-compute-engine (2.8.15-1) stable; urgency=low

* Fix XPS settings with more than 64 vCPUs.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-compute-engine/packaging/setup_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

NAME="google-compute-engine"
VERSION="2.8.15"
VERSION="2.8.16"

working_dir=${PWD}
if [[ $(basename "$working_dir") != $NAME ]]; then
Expand Down
2 changes: 1 addition & 1 deletion packages/google-compute-engine/packaging/setup_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

NAME="google-compute-engine"
VERSION="2.8.15"
VERSION="2.8.16"

rpm_working_dir=/tmp/rpmpackage/${NAME}-${VERSION}
working_dir=${PWD}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def _WriteHostKeyToGuestAttributes(self, key_type, key_value):
"""Write a host key to guest attributes, ignoring errors."""
headers = {'Metadata-Flavor': 'Google'}
url = '%s/%s/%s' % (GUEST_ATTRIBUTES_URL, HOSTKEY_NAMESPACE, key_type)
key_value = key_value.encode('utf-8')
req = PutRequest(url, key_value, headers)
try:
response = urlrequest.urlopen(req)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ def testSetSshHostKeys(self):
def testWriteHostKeyToGuestAttributes(self, mock_put, mock_urlopen):
key_type = 'ssh-rsa'
key_value = 'asdfasdf'
encoded_key_value = key_value.encode('utf-8')
expected_url = ('http://metadata.google.internal/computeMetadata/v1beta1/'
'instance/guest-attributes/hostkeys/%s' % key_type)
headers = {'Metadata-Flavor': 'Google'}
Expand All @@ -343,7 +344,7 @@ def testWriteHostKeyToGuestAttributes(self, mock_put, mock_urlopen):
self.mock_setup, key_type, key_value)
self.mock_logger.info.assert_called_with(
'Wrote %s host key to guest attributes.', key_type)
mock_put.assert_called_with(expected_url, key_value, headers)
mock_put.assert_called_with(expected_url, encoded_key_value, headers)

mock_urlopen.side_effect = instance_setup.urlerror.HTTPError(
'http://foo', 403, 'Forbidden', {}, None)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
python-google-compute-engine (2.8.16-1) stable; urgency=low

* Fix guest attributes flow in Python 3.

-- Google Cloud Team <[email protected]> Tue, 22 May 2019 12:00:00 -0700

python-google-compute-engine (2.8.15-1) stable; urgency=low

* Retry download for metadata scripts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

NAME="python-google-compute-engine"
VERSION="2.8.15"
VERSION="2.8.16"

working_dir=${PWD}
if [[ $(basename "$working_dir") != $NAME ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

NAME="python-google-compute-engine"
VERSION="2.8.15"
VERSION="2.8.16"

rpm_working_dir=/tmp/rpmpackage/${NAME}-${VERSION}
working_dir=${PWD}
Expand Down
2 changes: 1 addition & 1 deletion packages/python-google-compute-engine/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
name='google-compute-engine',
packages=setuptools.find_packages(),
url='https://github.com/GoogleCloudPlatform/compute-image-packages',
version='2.8.15',
version='2.8.16',
# Entry points create scripts in /usr/bin that call a function.
entry_points={
'console_scripts': [
Expand Down

0 comments on commit 14f700e

Please sign in to comment.