Skip to content
This repository was archived by the owner on Dec 21, 2022. It is now read-only.

Conversation

JesseAldridge
Copy link

I used storm to parse my ssh config file for this tool: https://github.com/JesseAldridge/ssh_fixer
Unfortunately, it seems the CamelCase is lost and the output looks a bit ugly.

Before:

Host repo_quality
    HostName 54.172.109.248
    User ubuntu
    IdentityFile ~/.ssh/id_rsa2
    Cipher blowfish

After:

Host repo_quality
    identityfile ~/.ssh/id_rsa2
    hostname 54.172.109.248
    user ubuntu
    cipher blowfish

This PR preserves the original casing.

@emre
Copy link
Owner

emre commented Sep 5, 2016

Can you squash two commits into one commit? Looks legit.

Thanks for the contribution.

@JesseAldridge
Copy link
Author

Done.

content = f.read().encode('ascii')
self.assertIn(b'identityfile "/tmp/idfilecheck.rsa"', content)
self.assertIn(b'IdentityFile "/tmp/idfilecheck.rsa"', content)
self.assertIn(b"stricthostkeychecking yes", content)
Copy link

@StephenBrown2 StephenBrown2 Sep 29, 2016

Choose a reason for hiding this comment

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

Should these (StrictHostKeyChecking and UserKnownHostsFile) not also assert CamelCase?

Copy link
Author

@JesseAldridge JesseAldridge Sep 29, 2016

Choose a reason for hiding this comment

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

Hmm, maybe so. Those look to be coming from --o "StrictHostKeyChecking=yes" above... which I guess means something like "Add this key val pair".

But really the only part of this project I actually care about is this one file: storm/parsers/ssh_config_parser.py. Maybe I should just break that file out into a separate micro-repo and close this PR.

Choose a reason for hiding this comment

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

Yeah, I wonder why dump() isn't respecting the camelcase of the --o option. Need to dig into it further, even though it looks like you've got the lower_to_original function implemented there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants