Skip to content

Commit

Permalink
Remove redundant sanity code. Tracker this.
Browse files Browse the repository at this point in the history
"get_domains" returns a cache, so prodding the full list can be faulty anyway.
  • Loading branch information
dormando committed May 25, 2011
1 parent ce5d31d commit 3927bf6
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions mogadm
Original file line number Diff line number Diff line change
Expand Up @@ -638,12 +638,7 @@ sub cmd_domain_list {
sub cmd_domain_add {
my $args = shift;

my $domains = domains() or
fail_text('no_domains');

# make sure it doesn't exist
my $domain = delete $args->{domain};
fail('Domain already exists.') if $domains->{$domain};

# create
my $mogadm = mogadm();
Expand All @@ -657,12 +652,8 @@ sub cmd_domain_add {

sub cmd_domain_delete {
my $args = shift;
my $domains = domains() or
fail_text('no_domains');

# make sure it doesn't exist
my $domain = $args->{domain};
fail('Domain not found.') unless $domains->{$domain};

# destroy
my $mogadm = mogadm();
Expand All @@ -681,15 +672,11 @@ sub cmd_class_list {

sub cmd_class_add {
my $args = shift;
my $domains = domains() or
fail_text('no_domains');

my $domain = delete $args->{domain};
my $class = delete $args->{class};

cmd_help_die() unless $domain && $class;
fail('Domain not found.') unless $domains->{$domain};
fail('Class already exists.') if $domains->{$domain}->{$class};

$args->{mindevcount} ||= 2;
$args->{replpolicy} ||= '';
Expand All @@ -705,15 +692,11 @@ sub cmd_class_add {

sub cmd_class_modify {
my $args = shift;
my $domains = domains() or
fail_text('no_domains');

my $domain = delete $args->{domain};
my $class = delete $args->{class};

cmd_help_die() unless $domain && $class;
fail('Domain not found.') unless $domains->{$domain};
fail('Class does not exist.') unless $domains->{$domain}->{$class};

$args->{mindevcount} ||= 2;
$args->{replpolicy} ||= '';
Expand All @@ -730,15 +713,10 @@ sub cmd_class_modify {
sub cmd_class_delete {
my $args = shift;

my $domains = domains() or
fail_text('no_domains');

my $domain = $args->{domain};
my $class = $args->{class};

cmd_help_die() unless $domain && $class;
fail('Domain not found.') unless $domains->{$domain};
fail('Class does not exist.') unless $domains->{$domain}->{$class};

my $mogadm = mogadm();
$mogadm->delete_class($domain, $class);
Expand Down

0 comments on commit 3927bf6

Please sign in to comment.