Skip to content

Commit

Permalink
fixed as black
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnaglodha committed Sep 17, 2024
1 parent 421ebac commit 0655781
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/geoserverx/_sync/gsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,17 @@ def check_modules(self, name) -> Union[bool, GSResponse]:
try:
response = Client.get("about/status.json")
response.raise_for_status() # Raises an HTTPError for bad responses (4xx and 5xx)

# Extract and check the modules
modules = [item["name"].lower() for item in response.json()["statuss"]["status"]]
modules = [
item["name"].lower() for item in response.json()["statuss"]["status"]
]
if name.lower() in modules:
return True
else:
# Raise exception if the plugin is not found
raise Exception("Plugin not found")

except httpx.HTTPStatusError as e:
# Handle HTTP errors (e.g., 4xx, 5xx)
self.response_recognise(e.response.status_code)
Expand All @@ -135,8 +137,6 @@ def check_modules(self, name) -> Union[bool, GSResponse]:
# Handle any other exceptions
return GSResponse(code=404, response=str(e))



# Get all workspaces
@exception_handler
def get_all_workspaces(self) -> Union[WorkspacesModel, GSResponse]:
Expand Down Expand Up @@ -469,7 +469,7 @@ def get_all_layer_groups(
def get_all_geofence_rules(self) -> Union[RulesResponse, GSResponse]:
Client = self.http_client
# Check if the geofence plugin exists
module_check= self.check_modules("geofence")
module_check = self.check_modules("geofence")
# If the module check fails, return the GSResponse directly
if isinstance(module_check, GSResponse):
return module_check
Expand Down
2 changes: 1 addition & 1 deletion src/geoserverx/models/geofence.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class LayerDetails(BaseModel):
class Rule(BaseModel):
priority: int
userName: Optional[str] = None
roleName: Optional[str] = None
roleName: Optional[str] = None
addressRange: Optional[str] = None
workspace: Optional[str] = None
layer: Optional[str] = None
Expand Down

0 comments on commit 0655781

Please sign in to comment.