azure-puppet/lib/puppet/affinity_group.rb

54 строки
1.5 KiB
Ruby
Исходник Обычный вид История

#-------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies, Inc.
# All Rights Reserved. Licensed under the Apache 2.0 License.
#--------------------------------------------------------------------------
2013-12-06 14:47:08 +04:00
require 'puppet/application_config'
include Puppet::ApplicationConfig
module Puppet::AffinityGroup
class << self
def views(name)
File.join(File.dirname(__FILE__), 'face/azure_affinitygroup/views', name)
2013-12-06 14:47:08 +04:00
end
def add_create_options(action)
add_default_options(action)
add_affinity_group_name_option(action)
2013-12-23 13:00:57 +04:00
add_location_option(action)
2013-12-06 14:47:08 +04:00
add_description_option(action)
add_label_option(action)
end
def add_delete_options(action)
add_default_options(action)
2013-12-23 13:00:57 +04:00
add_affinity_group_name_option(action)
2013-12-06 14:47:08 +04:00
end
def add_update_options(action)
add_default_options(action)
add_affinity_group_name_option(action)
add_label_option(action)
add_description_option(action)
end
def add_description_option(action)
action.option '--description=' do
2013-12-24 11:10:48 +04:00
summary 'Description of affinity group'
description 'Description of affinity group.'
2013-12-06 14:47:08 +04:00
end
end
def add_label_option(action)
action.option '--label=' do
2013-12-24 11:10:48 +04:00
summary 'Label of affinity group'
description 'Label of affinity group.'
2013-12-06 14:47:08 +04:00
required
2013-12-24 11:55:42 +04:00
before_action do |act, args, options|
fail ArgumentError, 'Label is required' if options[:label].empty?
2013-12-06 14:47:08 +04:00
end
end
end
end
end