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

Fixed issue which caused provisioning of domain each time because of … #14

Merged
merged 3 commits into from Feb 12, 2016

Conversation

adityakalia
Copy link
Contributor

Fixed issue which caused provisioning of domain each time because of provisioning command mismatch between provision command from overcast.conf and one returned by existing domain in kvm, the comparison failure is caused by trailing blank space on provision command in overcast.conf. Provisioning command on kvm is returned without a training space even if it exists on original command. This causes a comparison failure and provisioning of new image each time.

@@ -86,7 +86,7 @@
List<Filesystem> filesystemMappings, List<String> copySpec) {
super(libvirt, baseDomainName, ipLookupStrategy, networkName, startTimeout, bootDelay, filesystemMappings);
this.provisionUrl = checkNotNullOrEmpty(provisionUrl, "provisionUrl");
this.provisionCmd = checkNotNullOrEmpty(provisionCmd, "provisionCmd");
this.provisionCmd = checkNotNullOrEmpty(provisionCmd, "provisionCmd").trim();
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the trim be on the inside of the check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We trim once 'checkNotNullOrEmpty' check has passed, at this point we are sure that trim operation will not throw a null pointer exception.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ric's point is that a .trim() might actually make you end up with an empty string.

rklaren pushed a commit that referenced this pull request Feb 12, 2016
Fix detection of already provisioned domain when provision command ends in spaces
@rklaren rklaren merged commit 04a6997 into xebialabs:master Feb 12, 2016
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