-
Notifications
You must be signed in to change notification settings - Fork 46
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
This PR allows node attributes to be set for Developer Apple ID credentials while downloading Xcode from Apple:
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.