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

(FACT-1317) Fix YAML output of non-numeric types #1261

Merged
merged 1 commit into from
Feb 5, 2016

Conversation

MikaelSmith
Copy link

Several formats intended to be non-numeric are interpreted as numbers in
(Ruby) YAML.

Mac and IPv6 addresses as sexagesimal types:
10:10:10:10:10:10:10:10
01:23:45:54:32:21

Comma-delimited lists as comma-delimited integers:
1,2,3,4,5
123,456

Modify YAML quoting to ensure these patterns are quoted.

@MikaelSmith
Copy link
Author

Merge after release

@MikaelSmith MikaelSmith changed the title DO NOT MERGE (FACT-1317) Fix YAML output of non-numeric types (FACT-1317) Fix YAML output of non-numeric types Jan 27, 2016
bool has_separator = false;
// Note: Ruby YAML interprets 1,2,3 as a number, but not 1.2.3.
// It doesn't appear to honor locales when parsing YAML.
bool has_dot = false;
for (size_t i = 0; i < str.size(); ++i) {
Copy link

Choose a reason for hiding this comment

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

any reason why this isn't for(char c: str) ?

EDIT: white line, this is just how it was before. No need to change it in this PR unless you really want to

Copy link
Author

Choose a reason for hiding this comment

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

Update; i is used to check if it's the first character.

Several formats intended to be non-numeric are interpreted as numbers in
(Ruby) YAML.

Mac and IPv6 addresses as sexagesimal types:
  10:10:10:10:10:10:10:10
  01:23:45:54:32:21

Comma-delimited lists as comma-delimited integers:
  1,2,3,4,5
  123,456

Modify YAML quoting to ensure these patterns are quoted.
@MikaelSmith
Copy link
Author

Updated.

joshcooper added a commit that referenced this pull request Feb 5, 2016
(FACT-1317) Fix YAML output of non-numeric types
@joshcooper joshcooper merged commit fab5f41 into puppetlabs:stable Feb 5, 2016
@MikaelSmith MikaelSmith deleted the FACT-1317 branch February 10, 2016 19:40
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

3 participants