@@ -28,6 +28,9 @@ static const std::string DEST_GROUP_NAME("dest-group");
2828static const std::string GROUP_POOL_NAME (" group-" + at::POOL_NAME);
2929static const std::string IMAGE_POOL_NAME (" image-" + at::POOL_NAME);
3030
31+ static const std::string GROUP_NAMESPACE_NAME (" group-" + at::NAMESPACE_NAME);
32+ static const std::string IMAGE_NAMESPACE_NAME (" image-" + at::NAMESPACE_NAME);
33+
3134void add_group_option (po::options_description *opt,
3235 at::ArgumentModifier modifier) {
3336 std::string name = GROUP_NAME;
@@ -107,8 +110,8 @@ int execute_create(const po::variables_map &vm,
107110
108111 int r = utils::get_pool_generic_snapshot_names (
109112 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, at::POOL_NAME, &pool_name,
110- &namespace_name, GROUP_NAME, " group" , &group_name, nullptr , true ,
111- utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
113+ at::NAMESPACE_NAME, &namespace_name, GROUP_NAME, " group" , &group_name,
114+ nullptr , true , utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
112115 if (r < 0 ) {
113116 return r;
114117 }
@@ -187,8 +190,8 @@ int execute_remove(const po::variables_map &vm,
187190
188191 int r = utils::get_pool_generic_snapshot_names (
189192 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, at::POOL_NAME, &pool_name,
190- &namespace_name, GROUP_NAME, " group" , &group_name, nullptr , true ,
191- utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
193+ at::NAMESPACE_NAME, &namespace_name, GROUP_NAME, " group" , &group_name,
194+ nullptr , true , utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
192195 if (r < 0 ) {
193196 return r;
194197 }
@@ -221,8 +224,8 @@ int execute_rename(const po::variables_map &vm,
221224
222225 int r = utils::get_pool_generic_snapshot_names (
223226 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, at::POOL_NAME, &pool_name,
224- &namespace_name, GROUP_NAME, " group" , &group_name, nullptr , true ,
225- utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
227+ at::NAMESPACE_NAME, &namespace_name, GROUP_NAME, " group" , &group_name,
228+ nullptr , true , utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
226229 if (r < 0 ) {
227230 return r;
228231 }
@@ -233,9 +236,9 @@ int execute_rename(const po::variables_map &vm,
233236
234237 r = utils::get_pool_generic_snapshot_names (
235238 vm, at::ARGUMENT_MODIFIER_DEST, &arg_index, at::DEST_POOL_NAME,
236- &dest_pool_name, &dest_namespace_name, DEST_GROUP_NAME, " group " ,
237- &dest_group_name, nullptr , true , utils::SNAPSHOT_PRESENCE_NONE ,
238- utils::SPEC_VALIDATION_FULL);
239+ &dest_pool_name, at::DEST_NAMESPACE_NAME, &dest_namespace_name ,
240+ DEST_GROUP_NAME, " group " , &dest_group_name, nullptr , true ,
241+ utils::SNAPSHOT_PRESENCE_NONE, utils:: SPEC_VALIDATION_FULL);
239242 if (r < 0 ) {
240243 return r;
241244 }
@@ -283,8 +286,8 @@ int execute_info(const po::variables_map &vm,
283286
284287 int r = utils::get_pool_generic_snapshot_names (
285288 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, at::POOL_NAME, &pool_name,
286- &namespace_name, GROUP_NAME, " group" , &group_name, nullptr , true ,
287- utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
289+ at::NAMESPACE_NAME, &namespace_name, GROUP_NAME, " group" , &group_name,
290+ nullptr , true , utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
288291 if (r < 0 ) {
289292 return r;
290293 }
@@ -335,8 +338,9 @@ int execute_add(const po::variables_map &vm,
335338
336339 int r = utils::get_pool_generic_snapshot_names (
337340 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, GROUP_POOL_NAME,
338- &group_pool_name, &group_namespace_name, GROUP_NAME, " group" , &group_name,
339- nullptr , true , utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
341+ &group_pool_name, GROUP_NAMESPACE_NAME, &group_namespace_name,
342+ GROUP_NAME, " group" , &group_name, nullptr , true ,
343+ utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
340344 if (r < 0 ) {
341345 return r;
342346 }
@@ -347,9 +351,9 @@ int execute_add(const po::variables_map &vm,
347351
348352 r = utils::get_pool_generic_snapshot_names (
349353 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, IMAGE_POOL_NAME,
350- &image_pool_name, &image_namespace_name, at::IMAGE_NAME, " image " ,
351- &image_name, nullptr , true , utils::SNAPSHOT_PRESENCE_NONE ,
352- utils::SPEC_VALIDATION_FULL);
354+ &image_pool_name, IMAGE_NAMESPACE_NAME, &image_namespace_name ,
355+ at::IMAGE_NAME, " image " , &image_name, nullptr , true ,
356+ utils::SNAPSHOT_PRESENCE_NONE, utils:: SPEC_VALIDATION_FULL);
353357 if (r < 0 ) {
354358 return r;
355359 }
@@ -393,8 +397,9 @@ int execute_remove_image(const po::variables_map &vm,
393397
394398 int r = utils::get_pool_generic_snapshot_names (
395399 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, GROUP_POOL_NAME,
396- &group_pool_name, &group_namespace_name, GROUP_NAME, " group" , &group_name,
397- nullptr , true , utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
400+ &group_pool_name, GROUP_NAMESPACE_NAME, &group_namespace_name,
401+ GROUP_NAME, " group" , &group_name, nullptr , true ,
402+ utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
398403 if (r < 0 ) {
399404 return r;
400405 }
@@ -410,9 +415,9 @@ int execute_remove_image(const po::variables_map &vm,
410415
411416 r = utils::get_pool_generic_snapshot_names (
412417 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, IMAGE_POOL_NAME,
413- &image_pool_name, &image_namespace_name, at::IMAGE_NAME, " image " ,
414- &image_name, nullptr , image_id.empty (), utils::SNAPSHOT_PRESENCE_NONE ,
415- utils::SPEC_VALIDATION_FULL);
418+ &image_pool_name, IMAGE_NAMESPACE_NAME, &image_namespace_name ,
419+ at::IMAGE_NAME, " image " , &image_name, nullptr , image_id.empty (),
420+ utils::SNAPSHOT_PRESENCE_NONE, utils:: SPEC_VALIDATION_FULL);
416421 if (r < 0 ) {
417422 return r;
418423 }
@@ -464,8 +469,8 @@ int execute_list_images(const po::variables_map &vm,
464469
465470 int r = utils::get_pool_generic_snapshot_names (
466471 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, at::POOL_NAME, &pool_name,
467- &namespace_name, GROUP_NAME, " group" , &group_name, nullptr , true ,
468- utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
472+ at::NAMESPACE_NAME, &namespace_name, GROUP_NAME, " group" , &group_name,
473+ nullptr , true , utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
469474 if (r < 0 ) {
470475 return r;
471476 }
@@ -563,8 +568,9 @@ int execute_group_snap_create(const po::variables_map &vm,
563568
564569 int r = utils::get_pool_generic_snapshot_names (
565570 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, at::POOL_NAME, &pool_name,
566- &namespace_name, GROUP_NAME, " group" , &group_name, &snap_name, true ,
567- utils::SNAPSHOT_PRESENCE_REQUIRED, utils::SPEC_VALIDATION_FULL);
571+ at::NAMESPACE_NAME, &namespace_name, GROUP_NAME, " group" , &group_name,
572+ &snap_name, true , utils::SNAPSHOT_PRESENCE_REQUIRED,
573+ utils::SPEC_VALIDATION_FULL);
568574 if (r < 0 ) {
569575 return r;
570576 }
@@ -604,8 +610,9 @@ int execute_group_snap_remove(const po::variables_map &vm,
604610
605611 int r = utils::get_pool_generic_snapshot_names (
606612 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, at::POOL_NAME, &pool_name,
607- &namespace_name, GROUP_NAME, " group" , &group_name, &snap_name, true ,
608- utils::SNAPSHOT_PRESENCE_REQUIRED, utils::SPEC_VALIDATION_FULL);
613+ at::NAMESPACE_NAME, &namespace_name, GROUP_NAME, " group" , &group_name,
614+ &snap_name, true , utils::SNAPSHOT_PRESENCE_REQUIRED,
615+ utils::SPEC_VALIDATION_FULL);
609616 if (r < 0 ) {
610617 return r;
611618 }
@@ -640,8 +647,9 @@ int execute_group_snap_rename(const po::variables_map &vm,
640647
641648 int r = utils::get_pool_generic_snapshot_names (
642649 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, at::POOL_NAME, &pool_name,
643- &namespace_name, GROUP_NAME, " group" , &group_name, &source_snap_name, true ,
644- utils::SNAPSHOT_PRESENCE_REQUIRED, utils::SPEC_VALIDATION_FULL);
650+ at::NAMESPACE_NAME, &namespace_name, GROUP_NAME, " group" , &group_name,
651+ &source_snap_name, true , utils::SNAPSHOT_PRESENCE_REQUIRED,
652+ utils::SPEC_VALIDATION_FULL);
645653 if (r < 0 ) {
646654 return r;
647655 }
@@ -696,8 +704,8 @@ int execute_group_snap_list(const po::variables_map &vm,
696704
697705 int r = utils::get_pool_generic_snapshot_names (
698706 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, at::POOL_NAME, &pool_name,
699- &namespace_name, GROUP_NAME, " group" , &group_name, nullptr , true ,
700- utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
707+ at::NAMESPACE_NAME, &namespace_name, GROUP_NAME, " group" , &group_name,
708+ nullptr , true , utils::SNAPSHOT_PRESENCE_NONE, utils::SPEC_VALIDATION_FULL);
701709 if (r < 0 ) {
702710 return r;
703711 }
@@ -764,8 +772,9 @@ int execute_group_snap_info(const po::variables_map &vm,
764772
765773 int r = utils::get_pool_generic_snapshot_names (
766774 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, at::POOL_NAME, &pool_name,
767- &namespace_name, GROUP_NAME, " group" , &group_name, &group_snap_name, true ,
768- utils::SNAPSHOT_PRESENCE_REQUIRED, utils::SPEC_VALIDATION_FULL);
775+ at::NAMESPACE_NAME, &namespace_name, GROUP_NAME, " group" , &group_name,
776+ &group_snap_name, true , utils::SNAPSHOT_PRESENCE_REQUIRED,
777+ utils::SPEC_VALIDATION_FULL);
769778 if (r < 0 ) {
770779 return r;
771780 }
@@ -872,8 +881,9 @@ int execute_group_snap_rollback(const po::variables_map &vm,
872881
873882 int r = utils::get_pool_generic_snapshot_names (
874883 vm, at::ARGUMENT_MODIFIER_NONE, &arg_index, at::POOL_NAME, &pool_name,
875- &namespace_name, GROUP_NAME, " group" , &group_name, &snap_name, true ,
876- utils::SNAPSHOT_PRESENCE_REQUIRED, utils::SPEC_VALIDATION_FULL);
884+ at::NAMESPACE_NAME, &namespace_name, GROUP_NAME, " group" , &group_name,
885+ &snap_name, true , utils::SNAPSHOT_PRESENCE_REQUIRED,
886+ utils::SPEC_VALIDATION_FULL);
877887 if (r < 0 ) {
878888 return r;
879889 }
@@ -954,9 +964,6 @@ void get_add_arguments(po::options_description *positional,
954964 add_prefixed_pool_option (options, " image" );
955965 add_prefixed_namespace_option (options, " image" );
956966 at::add_image_option (options, at::ARGUMENT_MODIFIER_NONE);
957-
958- at::add_pool_option (options, at::ARGUMENT_MODIFIER_NONE,
959- " unless overridden" );
960967}
961968
962969void get_remove_image_arguments (po::options_description *positional,
@@ -979,8 +986,6 @@ void get_remove_image_arguments(po::options_description *positional,
979986 add_prefixed_namespace_option (options, " image" );
980987 at::add_image_option (options, at::ARGUMENT_MODIFIER_NONE);
981988
982- at::add_pool_option (options, at::ARGUMENT_MODIFIER_NONE,
983- " unless overridden" );
984989 at::add_image_id_option (options);
985990}
986991
0 commit comments