Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1064 from joyent/ether/v3.0.7-fixes
Browse files Browse the repository at this point in the history
v3.0.7 misc fixes
  • Loading branch information
karenetheridge authored Nov 16, 2020
2 parents b150e2d + 2381db4 commit eff7296
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 104 deletions.
21 changes: 0 additions & 21 deletions docs/modules/Conch::Command::new_organizations.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* [Conch::Command::create_user](../modules/Conch::Command::create_user)
* [Conch::Command::fix_usernames](../modules/Conch::Command::fix_usernames)
* [Conch::Command::force_password_change](../modules/Conch::Command::force_password_change)
* [Conch::Command::new_organizations](../modules/Conch::Command::new_organizations)
* [Conch::Command::passwd](../modules/Conch::Command::passwd)
* [Conch::Command::thin_device_reports](../modules/Conch::Command::thin_device_reports)
* [Conch::Command::update_validation_plans](../modules/Conch::Command::update_validation_plans)
Expand Down
4 changes: 0 additions & 4 deletions docs/scripts/conch.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ Conch-specific commands are:

force a user (or by default, all users) to change their password

- [new\_organizations](../modules/Conch%3A%3ACommand%3A%3Anew_organizations)

create new organization data

- [passwd](../modules/Conch%3A%3ACommand%3A%3Apasswd)

Change a user's password
Expand Down
2 changes: 1 addition & 1 deletion lib/Conch/Command/fix_usernames.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sub run ($self, @opts) {
my ($opt, $usage) = describe_options(
# the descriptions aren't actually used anymore (mojo uses the synopsis instead)... but
# the 'usage' text block can be accessed with $usage->text
'clean_roles %o',
'fix_usernames %o',
[ 'dry-run|n', 'dry-run (no changes are made)' ],
[],
[ 'help', 'print usage message and exit', { shortcircuit => 1 } ],
Expand Down
2 changes: 1 addition & 1 deletion lib/Conch/Command/force_password_change.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sub run ($self, @opts) {
my ($opt, $usage) = describe_options(
# the descriptions aren't actually used anymore (mojo uses the synopsis instead)... but
# the 'usage' text block can be accessed with $usage->text
'clean_roles %o',
'force_password_change %o',
[ 'dry-run|n', 'dry-run (no changes are made)' ],
[ 'email=s@', 'email address of user to be modified (can be used more than once)' ],
[],
Expand Down
71 changes: 0 additions & 71 deletions lib/Conch/Command/new_organizations.pm

This file was deleted.

12 changes: 8 additions & 4 deletions lib/Conch/Command/thin_device_reports.pm
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ sub run ($self, @opts) {
}

say "\n$device_count devices processed.";
say $device_reports_deleted.' device_reports deleted.' if $device_reports_deleted;
say $device_reports_deleted.' device_reports '.($self->dry_run ? 'would be ' : '').'deleted.' if $device_reports_deleted;
say $validation_results_deleted.' validation_results deleted.' if $validation_results_deleted;

say 'at finish, we have this many records:';
Expand All @@ -98,10 +98,14 @@ sub _print_stats ($self) {
say 'validation_state: ', $self->app->db_ro_validation_states->count;
say 'validation_state_member: ', $self->app->db_ro_validation_state_members->count;
say 'validation_result: ', $self->app->db_ro_validation_results->count;
say '';
}

sub _process_device ($self, $device) {
my $report_count = 0;
my $report_count = $self->app->db_device_reports
->search({ 'device_report.device_id' => $device->id })
->count;

print 'device id ', $device->id, ': ';

my $query = <<'SQL';
Expand Down Expand Up @@ -131,7 +135,7 @@ SQL
->search({ 'device_report.id' => { -in => \[ $query, $device->id ] } });

my $device_reports_deleted;
my $validation_results_deleted;
my $validation_results_deleted = 0;

print "\n";

Expand All @@ -150,7 +154,7 @@ SQL
' out of ', $report_count, ' examined';

# now delete all newly-orphaned validation_result rows for this device
$validation_results_deleted = $device->delete_related('validation_results',
$validation_results_deleted += $device->delete_related('validation_results',
{ 'validation_state_members.validation_state_id' => undef },
{ join => 'validation_state_members' },
);
Expand Down
2 changes: 1 addition & 1 deletion lib/Conch/Plugin/Rollbar.pm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ message is sent to Rollbar.
delete $data->@{qw(level msg)};
$c->send_message_to_rollbar('error', 'api error', $data);
})
if $config->{rollbar}{error_match_header}->%*;
if keys(($config->{rollbar}{error_match_header}//{})->%*);


=head1 HELPERS
Expand Down

0 comments on commit eff7296

Please sign in to comment.