Skip to content

Commit

Permalink
Add missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
smokestacklightnin committed Nov 24, 2024
1 parent 1d825d4 commit 950f3d1
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 15 deletions.
13 changes: 7 additions & 6 deletions src/_nebari/stages/infrastructure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from _nebari.provider.cloud import amazon_web_services, azure_cloud, google_cloud
from _nebari.stages.base import NebariTerraformStage
from _nebari.stages.kubernetes_services import SharedFsEnum
from _nebari.stages.tf_objects import NebariOpentofuRequiredProvider
from _nebari.utils import (
AZURE_NODE_RESOURCE_GROUP_SUFFIX,
construct_azure_resource_group_name,
Expand Down Expand Up @@ -702,7 +703,7 @@ def tf_objects(self) -> List[Dict]:
if self.config.provider == schema.ProviderEnum.gcp:
return [
*resources,
opentofu.RequiredProvider(**constants.REQUIRED_PROVIDERS["google"]),
NebariOpentofuRequiredProvider("google", self.config),
opentofu.Provider(
"google",
project=self.config.google_cloud_platform.project,
Expand All @@ -712,20 +713,20 @@ def tf_objects(self) -> List[Dict]:
elif self.config.provider == schema.ProviderEnum.azure:
return [
*resources,
opentofu.RequiredProvider(**constants.REQUIRED_PROVIDERS["azure"]),
NebariOpentofuRequiredProvider("azurerm", self.config),
]
elif self.config.provider == schema.ProviderEnum.aws:
return [
*resources,
opentofu.RequiredProvider(**constants.REQUIRED_PROVIDERS["aws"]),
NebariOpentofuRequiredProvider("aws", self.config),
opentofu.Provider("aws", region=self.config.amazon_web_services.region),
]
elif self.config.provider == schema.ProviderEnum.local:
return [
*resource,
opentofu.RequiredProvider(**constants.REQUIRED_PROVIDERS["kind"]),
opentofu.RequiredProvider(**constants.REQUIRED_PROVIDERS["docker"]),
opentofu.RequiredProvider(**constants.REQUIRED_PROVIDERS["kubectl"]),
NebariOpentofuRequiredProvider("kind", self.config),
NebariOpentofuRequiredProvider("docker", self.config),
NebariOpentofuRequiredProvider("kubectl", self.config),
]
else:
return resources
Expand Down
6 changes: 5 additions & 1 deletion src/_nebari/stages/kubernetes_ingress/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
from _nebari import constants
from _nebari.provider.dns.cloudflare import update_record
from _nebari.stages.base import NebariTerraformStage
from _nebari.stages.tf_objects import NebariHelmProvider, NebariKubernetesProvider
from _nebari.stages.tf_objects import (
NebariHelmProvider,
NebariKubernetesProvider,
NebariOpentofuRequiredProvider,
)
from nebari import schema
from nebari.hookspecs import NebariStage, hookimpl

Expand Down
6 changes: 5 additions & 1 deletion src/_nebari/stages/kubernetes_keycloak/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
from pydantic import Field, ValidationInfo, field_validator

from _nebari.stages.base import NebariTerraformStage
from _nebari.stages.tf_objects import NebariHelmProvider, NebariKubernetesProvider
from _nebari.stages.tf_objects import (
NebariHelmProvider,
NebariKubernetesProvider,
NebariOpentofuRequiredProvider,
)
from _nebari.utils import modified_environ
from nebari import schema
from nebari.hookspecs import NebariStage, hookimpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from _nebari.stages.base import NebariTerraformStage
from _nebari.stages.kubernetes_keycloak import Authentication
from _nebari.stages.tf_objects import NebariOpentofuRequiredProvider
from nebari import schema
from nebari.hookspecs import NebariStage, hookimpl

Expand Down
6 changes: 5 additions & 1 deletion src/_nebari/stages/kubernetes_services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@

from _nebari import constants
from _nebari.stages.base import NebariTerraformStage
from _nebari.stages.tf_objects import NebariHelmProvider, NebariKubernetesProvider
from _nebari.stages.tf_objects import (
NebariHelmProvider,
NebariKubernetesProvider,
NebariOpentofuRequiredProvider,
)
from _nebari.utils import (
byte_unit_conversion,
set_docker_image_tag,
Expand Down
6 changes: 5 additions & 1 deletion src/_nebari/stages/nebari_tf_extensions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from typing import Any, Dict, List, Optional, Type

from _nebari.stages.base import NebariTerraformStage
from _nebari.stages.tf_objects import NebariHelmProvider, NebariKubernetesProvider
from _nebari.stages.tf_objects import (
NebariHelmProvider,
NebariKubernetesProvider,
NebariOpentofuRequiredProvider,
)
from nebari import schema
from nebari.hookspecs import NebariStage, hookimpl

Expand Down
14 changes: 9 additions & 5 deletions src/_nebari/stages/terraform_state/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@

from pydantic import BaseModel, field_validator

from _nebari import constants, utils
from _nebari import utils
from _nebari.provider import opentofu
from _nebari.provider.cloud import azure_cloud
from _nebari.stages.base import NebariTerraformStage
from _nebari.stages.tf_objects import NebariConfig, NebariOpentofuRequiredVersion
from _nebari.stages.tf_objects import (
NebariConfig,
NebariOpentofuRequiredProvider,
NebariOpentofuRequiredVersion,
)
from _nebari.utils import (
AZURE_TF_STATE_RESOURCE_GROUP_SUFFIX,
construct_azure_resource_group_name,
Expand Down Expand Up @@ -166,7 +170,7 @@ def tf_objects(self) -> List[Dict]:
if self.config.provider == schema.ProviderEnum.gcp:
return [
*resources,
opentofu.RequiredProvider(**constants.REQUIRED_PROVIDERS["google"]),
NebariOpentofuRequiredProvider("google", self.config),
opentofu.Provider(
"google",
project=self.config.google_cloud_platform.project,
Expand All @@ -176,13 +180,13 @@ def tf_objects(self) -> List[Dict]:
elif self.config.provider == schema.ProviderEnum.aws:
return [
*resources,
opentofu.RequiredProvider(**constants.REQUIRED_PROVIDERS["aws"]),
NebariOpentofuRequiredProvider("aws", self.config),
opentofu.Provider("aws", region=self.config.amazon_web_services.region),
]
elif self.config.provider == schema.ProviderEnum.azure:
return [
*resources,
opentofu.RequiredProvider(**constants.REQUIRED_PROVIDERS["azurerem"]),
NebariOpentofuRequiredProvider("azurerm", self.config),
]
else:
return resources
Expand Down
1 change: 1 addition & 0 deletions src/_nebari/stages/tf_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from _nebari.provider.opentofu import (
Data,
Provider,
RequiredProvider,
Resource,
Terraform,
TerraformBackend,
Expand Down

0 comments on commit 950f3d1

Please sign in to comment.