Skip to content

Commit

Permalink
Add the KeyDollarListDict in DataStore class so that it's its respons…
Browse files Browse the repository at this point in the history
…ability to parse connection parameters
  • Loading branch information
danduk82 committed Oct 14, 2024
1 parent ddcee50 commit 421ae04
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
40 changes: 18 additions & 22 deletions geoservercloud/geoservercloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,17 @@ def create_pg_datastore(
datastore = PostGisDataStore(
workspace_name,
datastore_name,
connection_parameters=KeyDollarListDict(
input_dict={
"dbtype": "postgis",
"host": pg_host,
"port": pg_port,
"database": pg_db,
"user": pg_user,
"passwd": pg_password,
"schema": pg_schema,
"namespace": f"http://{workspace_name}",
"Expose primary keys": "true",
}
),
connection_parameters={
"dbtype": "postgis",
"host": pg_host,
"port": pg_port,
"database": pg_db,
"user": pg_user,
"passwd": pg_password,
"schema": pg_schema,
"namespace": f"http://{workspace_name}",
"Expose primary keys": "true",
},
data_store_type="PostGIS",
description=description,
)
Expand Down Expand Up @@ -258,15 +256,13 @@ def create_jndi_datastore(
datastore = PostGisDataStore(
workspace_name,
datastore_name,
connection_parameters=KeyDollarListDict(
input_dict={
"dbtype": "postgis",
"jndiReferenceName": jndi_reference,
"schema": pg_schema,
"namespace": f"http://{workspace_name}",
"Expose primary keys": "true",
}
),
connection_parameters={
"dbtype": "postgis",
"jndiReferenceName": jndi_reference,
"schema": pg_schema,
"namespace": f"http://{workspace_name}",
"Expose primary keys": "true",
},
data_store_type="PostGIS (JNDI)",
description=description,
)
Expand Down
4 changes: 2 additions & 2 deletions geoservercloud/models/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ def __init__(
self,
workspace_name: str,
data_store_name: str,
connection_parameters: KeyDollarListDict,
connection_parameters: dict,
data_store_type: str = "PostGIS",
enabled: bool = True,
description: str | None = None,
) -> None:
self.workspace_name = workspace_name
self.data_store_name = data_store_name
self.connection_parameters = connection_parameters
self.connection_parameters = KeyDollarListDict(input_dict=connection_parameters)
self.data_store_type = data_store_type
self.description = description
self.enabled = enabled
Expand Down

0 comments on commit 421ae04

Please sign in to comment.