Skip to content

Added code to create a file that indicates Maintenance Mode#87

Open
mbhask000 wants to merge 6 commits into
Comcast:masterfrom
mbhask000:bhaskar_Bynar
Open

Added code to create a file that indicates Maintenance Mode#87
mbhask000 wants to merge 6 commits into
Comcast:masterfrom
mbhask000:bhaskar_Bynar

Conversation

@mbhask000
Copy link
Copy Markdown
Contributor

No description provided.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Aug 30, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Collaborator

@cholcombe973 cholcombe973 left a comment

Choose a reason for hiding this comment

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

It looks like service.rs is a new checked in file that is generated. I think it should probably be added to the .gitignore file. Overall this looks fine.

Comment thread src/client.rs Outdated
@sdandam sdandam self-requested a review August 30, 2019 15:56
@mbhask000
Copy link
Copy Markdown
Contributor Author

Changed SetMaintenance subcommand to set_maintenance

@mbhask000
Copy link
Copy Markdown
Contributor Author

Added additional code to remove the set maintenance status.

Copy link
Copy Markdown
Collaborator

@cholcombe973 cholcombe973 left a comment

Choose a reason for hiding this comment

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

Looks good to me

Copy link
Copy Markdown
Collaborator

@sdandam sdandam left a comment

Choose a reason for hiding this comment

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

Bynar should also bail out if it finds a lock file aka in maintenance mode.

Comment thread src/client.rs Outdated
trace!("handle_set_maintenance called");
helpers::set_maintenance(s)?;
trace!("handle_set_maintenance finished");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: extra line can be removed

Comment thread src/client.rs Outdated
trace!("handle_unset_maintenance called");
helpers::unset_maintenance(s)?;
trace!("handle_unset_maintenance finished");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: extra line can be removed

Comment thread src/disk_manager.rs Outdated
result.set_result(ResultType::OK);
}
Err(..) => {
result.set_result(ResultType::ERR);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think an error string should also be set here, so that the caller/client knows the reason why the operation failed

Comment thread src/disk_manager.rs Outdated
result.set_result(ResultType::OK);
}
Err(..) => {
result.set_result(ResultType::ERR);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

error string should be set here too.

Comment thread src/disk_manager.rs

pub fn set_maintenance(s: &mut Socket) -> BynarResult<()>{
let mut result = OpResult::new();
let file = match File::create("/var/log/setMaintenance.lock") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This file location should be read from the config file

Comment thread src/disk_manager.rs
}
pub fn unset_maintenance(s: &mut Socket) -> BynarResult<()>{
let mut result = OpResult::new();
let file = match fs::remove_file("/var/log/setMaintenance.lock") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This file location should be read from config file

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.

5 participants