Skip to content

Commit

Permalink
Fix to test can_use_gcloud_storage_creds as available in Pro only
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Apr 21, 2023
1 parent 28873eb commit a0f1c09
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cloud-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ sub cloud_google_get_state
"<tt>$config{'google_project'}</tt>"),
};
}
elsif (&can_use_gcloud_storage_creds()) {
elsif ($virtualmin_pro && &can_use_gcloud_storage_creds()) {
return { 'ok' => 1,
'desc' => $text{'cloud_gcpcreds'},
};
Expand All @@ -313,7 +313,8 @@ sub cloud_google_get_state

sub cloud_google_longdesc
{
if (!$config{'google_account'} && &can_use_gcloud_storage_creds()) {
if (!$config{'google_account'} && $virtualmin_pro &&
&can_use_gcloud_storage_creds()) {
return $text{'cloud_google_creds'};
}
else {
Expand All @@ -326,7 +327,8 @@ sub cloud_google_show_inputs
{
my $rv;

if (&can_use_gcloud_storage_creds() && !$config{'google_account'}) {
if ($virtualmin_pro && &can_use_gcloud_storage_creds() &&
!$config{'google_account'}) {
$rv .= &ui_table_row($text{'cloud_google_account'},
&get_gcloud_account());

Expand Down Expand Up @@ -374,7 +376,8 @@ sub cloud_google_parse_inputs
my $reauth = 0;
my $authed = 0;

if (&can_use_gcloud_storage_creds() && !$config{'google_account'}) {
if ($virtualmin_pro && &can_use_gcloud_storage_creds() &&
!$config{'google_account'}) {
# Just parse project name
$authed = 1;
if ($in->{'google_project_def'}) {
Expand Down

0 comments on commit a0f1c09

Please sign in to comment.