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

Add check for a single domain in git import #124

Merged
merged 2 commits into from
Dec 20, 2017
Merged

Add check for a single domain in git import #124

merged 2 commits into from
Dec 20, 2017

Conversation

pkomanek
Copy link
Contributor

@pkomanek pkomanek commented Dec 1, 2017

Disabling the import of multiple domains from a single git repo.

based on: https://bugzilla.redhat.com/show_bug.cgi?id=1497570

MiqAeDomain.find_by(:name => @options['domain']).try(:destroy) if @options['domain'] && !@preview
result = MiqAeYamlImportGitfs.new(@options['domain'] || '*', @options).import
domain = Array.wrap(result).first
MiqAeDomain.find_by(:name => @options['domain']).try(:destroy) if @options['domain'] && !@previewZ
Copy link
Contributor

Choose a reason for hiding this comment

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

@pkomanek
Is it previewZ or preview?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thank you @mkanoor

Copy link
Contributor

@mkanoor mkanoor left a comment

Choose a reason for hiding this comment

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

Fix Typo

@miq-bot
Copy link
Member

miq-bot commented Dec 15, 2017

Checked commits pkomanek/manageiq-automation_engine@0b5deb8~...94ab21e with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 👍

@pkomanek pkomanek changed the title [WIP]Add check for a single domain in git import Add check for a single domain in git import Dec 15, 2017
@miq-bot miq-bot removed the wip label Dec 15, 2017
@mkanoor mkanoor merged commit 1a3c527 into ManageIQ:master Dec 20, 2017
simaishi pushed a commit that referenced this pull request Jan 3, 2018
Add check for a single domain in git import
(cherry picked from commit 1a3c527)
@simaishi
Copy link
Contributor

simaishi commented Jan 3, 2018

Gaprindashvili backport details:

$ git log -1
commit ef744f1aa985f34398fa35be6cd029786d38ee7f
Author: Madhu Kanoor <[email protected]>
Date:   Wed Dec 20 15:00:37 2017 -0500

    Merge pull request #124 from pkomanek/ae_git_import_multiple_domains
    
    Add check for a single domain in git import
    (cherry picked from commit 1a3c52726425b2d96e325c61d3cdf2cf2a765c12)

it "raises an exception with a message about multiple domains" do
expect(MiqAeYamlImportGitfs).to receive(:new).with(domain_name, import_options)
.and_return(miq_ae_yaml_import_gitfs)
allow(miq_ae_yaml_import_gitfs).to receive(:domain_files) { ['BB8/__domain__.yaml', 'BB8/__domain__.yaml'] }

Choose a reason for hiding this comment

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

Wouldn't it make more sense to have the test with different directories? This looks to me like situation the code will never face - two fully identical paths :).

@pkomanek pkomanek deleted the ae_git_import_multiple_domains branch June 1, 2018 08:56
@pkomanek pkomanek restored the ae_git_import_multiple_domains branch June 1, 2018 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants