Merge branch 'master' of github.com:Mirantis/astute into deduplication_yaml

This commit is contained in:
Vladmir Sharhsov(warpc) 2013-08-07 16:52:14 +04:00
commit 057a720808
4 changed files with 34 additions and 1 deletions

View File

@ -1,4 +1,20 @@
#!/usr/bin/env ruby
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
require 'json'
require 'yaml'

View File

@ -1,4 +1,19 @@
#!/usr/bin/env ruby
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
require 'json'
require 'yaml'

View File

@ -26,7 +26,7 @@ module Astute
@username = Shellwords.escape(credentials['redhat']['username'])
@password = Shellwords.escape(credentials['redhat']['password'])
satellite = credentials['redhat']['satellite']
if satellite && !satellite.empty?
if credentials['redhat']['license_type'] == 'rhn' && satellite && !satellite.empty?
@satellite_server = Shellwords.escape(satellite)
end

View File

@ -25,6 +25,7 @@ describe Astute::RedhatChecker do
{
'release_name' => 'RELEASE_NAME',
'redhat' => {
'license_type' => 'rhsm',
'username' => 'user',
'password' => 'password'
}
@ -118,6 +119,7 @@ describe Astute::RedhatChecker do
{
'release_name' => 'RELEASE_NAME',
'redhat' => {
'license_type' => 'rhn',
'username' => 'user',
'password' => 'password',
'satellite' => 'satellite.server.com'