lib/kiwi_config.rb in machinery-tool-1.22.1 vs lib/kiwi_config.rb in machinery-tool-1.22.2
- old
+ new
@@ -13,11 +13,11 @@
# along with this program; if not, contact SUSE LLC.
#
# To contact SUSE about this file by physical or electronic mail,
# you may find current contact information at www.suse.com
-class KiwiConfig < Exporter
+class Machinery::KiwiConfig < Machinery::Exporter
attr_accessor :xml_text, :sh
attr_accessor :name
def initialize(system_description, options = {})
@name = "kiwi"
@@ -55,10 +55,14 @@
"#{@system_description.name}-kiwi"
end
private
+ def repos_with_credentials?(repo)
+ repo.username && repo.password
+ end
+
def optional_bootstrap_packages
[
"glibc-locale",
"module-init-tools",
"cracklib-dict-full",
@@ -194,11 +198,11 @@
)
end
end
def check_exported_os
- unless @system_description.os.is_a?(OsSuse)
+ unless @system_description.os.is_a?(Machinery::OsSuse)
raise Machinery::Errors::ExportFailed.new(
"Export is not possible because the operating system " \
"'#{@system_description.os.display_name}' is not supported."
)
end
@@ -291,11 +295,11 @@
xml.repository(parameters) do
xml.source(path: repo.url)
end
end
- next if repo.url =~ /^https:\/\/nu.novell.com|^https:\/\/update.suse.com/
+ next if repos_with_credentials?(repo)
@sh << "zypper -n ar --name='#{repo.name}' "
@sh << "--type='#{repo.type}' " if repo.type
@sh << "--refresh " if repo.autorefresh
@sh << "--disable " unless repo.enabled
@@ -371,10 +375,10 @@
end
end
end
def enable_dhcp(output_location)
- if @system_description.os.is_a?(OsSles11)
+ if @system_description.os.is_a?(Machinery::OsSles11)
write_dhcp_network_config(output_location, "eth0")
else
write_dhcp_network_config(output_location, "lan0")
write_persistent_net_rules(output_location)
end