mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Corrected a wrongly spelled key and added domain_name to the error output
This commit is contained in:
parent
9d6f6238bc
commit
b4993072a8
@ -5,6 +5,7 @@ module VagrantPlugins
|
|||||||
# Setup name for domain and domain volumes.
|
# Setup name for domain and domain volumes.
|
||||||
class SetNameOfDomain
|
class SetNameOfDomain
|
||||||
def initialize(app, env)
|
def initialize(app, env)
|
||||||
|
@logger = Log4r::Logger.new("vagrant_libvirt::action::set_name_of_domain")
|
||||||
@app = app
|
@app = app
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -15,11 +16,15 @@ module VagrantPlugins
|
|||||||
env[:domain_name] << '_'
|
env[:domain_name] << '_'
|
||||||
env[:domain_name] << env[:machine].name.to_s
|
env[:domain_name] << env[:machine].name.to_s
|
||||||
|
|
||||||
|
@logger.info("Looking for domain #{env[:domain_name]} through list #{env[:libvirt_compute].servers.all}")
|
||||||
# Check if the domain name is not already taken
|
# Check if the domain name is not already taken
|
||||||
domain = ProviderLibvirt::Util::Collection.find_matching(
|
domain = ProviderLibvirt::Util::Collection.find_matching(
|
||||||
env[:libvirt_compute].servers.all, env[:domain_name])
|
env[:libvirt_compute].servers.all, env[:domain_name])
|
||||||
|
|
||||||
|
@logger.info("Looking for domain #{env[:domain_name]}")
|
||||||
|
|
||||||
if domain != nil
|
if domain != nil
|
||||||
raise Vagrant::Errors::DomainNameExists,
|
raise ProviderLibvirt::Errors::DomainNameExists,
|
||||||
:domain_name => env[:domain_name]
|
:domain_name => env[:domain_name]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ module VagrantPlugins
|
|||||||
end
|
end
|
||||||
|
|
||||||
class DomainNameExists < VagrantLibvirtError
|
class DomainNameExists < VagrantLibvirtError
|
||||||
error_key(:domain_name_exists_error)
|
error_key(:domain_name_exists)
|
||||||
end
|
end
|
||||||
|
|
||||||
class NoDomainError < VagrantLibvirtError
|
class NoDomainError < VagrantLibvirtError
|
||||||
|
@ -89,7 +89,7 @@ en:
|
|||||||
fog_create_server_error: |-
|
fog_create_server_error: |-
|
||||||
Error while creating domain: %{error_message}
|
Error while creating domain: %{error_message}
|
||||||
domain_name_exists: |-
|
domain_name_exists: |-
|
||||||
Name of domain about to create is already taken. Please try to run
|
Name `%{domain_name}` of domain about to create is already taken. Please try to run
|
||||||
`vagrant up` command again.
|
`vagrant up` command again.
|
||||||
creating_storage_pool_error: |-
|
creating_storage_pool_error: |-
|
||||||
There was error while creating libvirt storage pool: %{error_message}
|
There was error while creating libvirt storage pool: %{error_message}
|
||||||
|
Loading…
Reference in New Issue
Block a user