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

Validate Homu TOML file #420

Merged
merged 1 commit into from
Jul 11, 2016
Merged

Validate Homu TOML file #420

merged 1 commit into from
Jul 11, 2016

Conversation

Crimack
Copy link
Contributor

@Crimack Crimack commented Jul 1, 2016

Draft of resolution to #407. config_path in sls/homu/toml.py is definitely wrong and should be corrected


This change is Reviewable

@Crimack
Copy link
Contributor Author

Crimack commented Jul 1, 2016

@aneeshusa I think I see what I've done wrong. I should be checking the generated TOML file at /etc/init/homu.conf on servo-master1 rather than the Jinja template, right?

@Crimack Crimack changed the title Initial attempt to solve issue 407 Validate Homu TOML file Jul 1, 2016
@aneeshusa
Copy link
Contributor

Correct!

@Crimack Crimack force-pushed the 407_valid_toml branch 3 times, most recently from 29d0563 to 7a77865 Compare July 1, 2016 19:48
config_path = os.path.join('/home', 'servo', 'homu', 'cfg.toml')
with open(config_path) as conf:
try:
toml.loads(conf.read())
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use toml.load instead which will handle opening and closing the file for us.

@Crimack
Copy link
Contributor Author

Crimack commented Jul 4, 2016

I think that's all your comments cleared up. Thank you for the feedback by the way, it was very easy to follow!

The additions to homu/init.sls might be wrong though? I wasn't sure if I should make a new 'block' (not sure what the proper SaltStack term for this is), or add it to one of the existing ones.

toml:
pip.installed:
- pkgs:
- toml == 0.9.1 # Ensure this is up to date with requirements.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of a separate Salt state (block), add this to the pip.installed state above that installed Homu. Also, let's say 'in sync' instead of 'up to date'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done :)

@aneeshusa
Copy link
Contributor

LGTM aside from that last comment, so go ahead and squash when you address that.

@Crimack
Copy link
Contributor Author

Crimack commented Jul 7, 2016

All good now I think!

@aneeshusa
Copy link
Contributor

Checked this locally in Vagrant and everything looks good. @bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 5e284fa has been approved by aneeshusa

@bors-servo
Copy link
Contributor

⌛ Testing commit 5e284fa with merge 4d25967...

bors-servo pushed a commit that referenced this pull request Jul 11, 2016
Validate Homu TOML file

Draft of resolution to #407. `config_path` in sls/homu/toml.py is definitely wrong and should be corrected

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/420)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - travis

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.

3 participants