Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow node attributes to be set for Apple ID credentials, increase install timeout #81

Merged
merged 6 commits into from
Mar 26, 2018

Conversation

jazaval
Copy link
Contributor

@jazaval jazaval commented Mar 26, 2018

This PR allows node attributes to be set for Developer Apple ID credentials while downloading Xcode from Apple:

node['macos']['apple_id']['user']
node['macos']['apple_id']['password']

This PR also increases the timeout for the Xcode download and install process to 2 hours, and deletes a library method bundle_version_correct? since it doesn't work (unsuccessfully tries to access node attributes in Xcode library).

Fixes #80 and #76.

@jazaval jazaval self-assigned this Mar 26, 2018
@@ -9,9 +9,15 @@ def installed?(semantic_version)
installed_xcodes.include?(semantic_version)
end

def bundle_version_correct?
xcode_version = '/Applications/Xcode.app/Contents/version.plist CFBundleShortVersionString'
node['macos']['xcode']['version'] == shell_out("defaults read #{xcode_version}").stdout.strip
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, this could still be accessed (set in this case), with Chef.node.default['macos']['xcode']['version']. However, since this method wasn't even used, I don't think there's any reason to keep it. Down the road, we'll probably use something like this when we implement load_current_value and check the current version before doing anything.

else
data_bag_retrieval.call
end
rescue Net::HTTPServerException
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a chance that we could get this exception under any other circumstances? If so, maybe our message should say something more generic, but include a hint that it is probably missing credentials that caused the error. IIRC, we've gotten errors before due to Apple's servers not responding, but I'm not sure if that's this exact exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rescue will only save exceptions arising from data_bag_retrieval.call, which is before we ever reach out to Apple.

@jazaval jazaval merged commit c1c14bb into release/1.10 Mar 26, 2018
@jazaval jazaval deleted the feature/xcode-fixes branch March 26, 2018 16:33
@americanhanko americanhanko mentioned this pull request Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants