Skip to content

Commit

Permalink
add more
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon committed Mar 14, 2024
1 parent f438bc0 commit a03c934
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/test_workflow/integ_test/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ def config_path(self) -> str:
"""
pass

@property
def log_dir(self) -> str:
"""
Return the log directory for the distribution
"""
pass

@abstractmethod
def install(self, bundle_name: str) -> None:
"""
Expand Down
6 changes: 5 additions & 1 deletion src/test_workflow/integ_test/distribution_deb.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def install_dir(self) -> str:
def config_path(self) -> str:
return os.path.join(os.sep, "etc", self.filename, self.config_filename)

@property
def log_dir(self) -> str:
return os.path.join(os.sep, "var", "logs", self.filename)

def install(self, bundle_name: str) -> None:
logging.info(f"Installing {bundle_name} in {self.install_dir}")
logging.info("deb installation requires sudo, script will exit if current user does not have sudo access")
Expand All @@ -44,7 +48,7 @@ def install(self, bundle_name: str) -> None:
'&&',
f'sudo chmod 0666 {self.config_path}',
'&&',
f'sudo chmod 0755 {os.path.dirname(self.config_path)}'
f'sudo chmod 0755 {os.path.dirname(self.config_path)} {self.log_dir}'
]
)
subprocess.check_call(deb_install_cmd, cwd=self.work_dir, shell=True)
Expand Down

0 comments on commit a03c934

Please sign in to comment.