Skip to content

Commit 1b18d51

Browse files
committed
Handle array of hashes in classifier.yaml in 2016.5
Prior to this commit, we assumed that classifier.yaml was simply a hash that had the server and port we wanted to know about for connecting to the classifier. After this commit, we know that classifier.yaml is an array of hashes in 2016.5.0 and above so we can correctly find the server and port that we want.
1 parent 9e16715 commit 1b18d51

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

manifests/code_manager.pp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@
1717
$create_role_creates_file = "${token_directory}/deploy_environments_created"
1818

1919
#master_classifier_settings is a custom function
20-
$classifier_settings = master_classifer_settings()
20+
#2016.5.0 makes classifer.yaml an array of hashes
21+
#instead of just a hash
22+
if versioncmp($::pe_server_version, '2016.5.0') >= 0 {
23+
$classifier_settings = master_classifer_settings()[0]
24+
} else {
25+
$classifier_settings = master_classifer_settings()
26+
}
27+
2128
$classifier_hostname = $classifier_settings['server']
2229
$classifier_port = $classifier_settings['port']
2330

0 commit comments

Comments
 (0)