Skip to content

Commit

Permalink
Deployment updates (#33)
Browse files Browse the repository at this point in the history
* Do 1Gb file updates

* Service.get_port()
  • Loading branch information
raulikak committed Apr 29, 2024
1 parent b267376 commit c184ad6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tcsfw/client_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ def copy_to_zipfile(self, files: List[pathlib.Path], temp_file: BinaryIO) -> boo
continue
# skip too large files
file_size_mb = file.stat().st_size // (1024 * 1024)
if file_size_mb > 16:
self.logger.warning("File too large: %s (%d > 16 M)", file.as_posix(), file_size_mb)
if file_size_mb > 1024:
self.logger.warning("File too large: %s (%d > 1024 M)", file.as_posix(), file_size_mb)
continue
# write content
self.logger.info("Adding %s", file.as_posix())
zip_info = zipfile.ZipInfo(file.name)
with file.open("rb") as file_data:
with zip_file.open(zip_info, "w") as of:
Expand Down
8 changes: 8 additions & 0 deletions tcsfw/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,14 @@ def is_encrypted(self) -> bool:
"""Is an encrypted service?"""
return self.protocol in {Protocol.TLS, Protocol.SSH}

def get_port(self) -> int:
"""Resolve port number, return -1 if not found"""
for a in self.addresses:
app = a.get_protocol_port()
if app:
return app[1]
return -1

def __repr__(self):
return f"{self.status_string()} {self.parent.long_name()} {self.name}"

Expand Down

0 comments on commit c184ad6

Please sign in to comment.