Skip to content

Conversation

mssalvatore
Copy link
Collaborator

What does this PR do?

Return a Path object from expand_path().

PR Checklist

  • Have you added an explanation of what your changes do and why you'd like to include them?
  • Is the TravisCI build passing?
  • Was the CHANGELOG.md updated to reflect the changes?
  • Was the documentation framework updated to reflect the changes?

Testing Checklist

  • Added relevant unit tests?
  • Have you successfully tested your changes locally? Elaborate:

    Tested by building and running an Appimage locally, running a few Docker blackbox tests, and running a few MSI blackbox tests.

  • If applicable, add screenshots or log transcripts of the feature working

@mssalvatore mssalvatore requested a review from shreyamalviya July 6, 2021 18:06
@codecov
Copy link

codecov bot commented Jul 6, 2021

Codecov Report

Merging #1300 (ae76872) into develop (9ed2145) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1300   +/-   ##
========================================
  Coverage    30.83%   30.84%           
========================================
  Files          454      454           
  Lines        13538    13539    +1     
========================================
+ Hits          4175     4176    +1     
  Misses        9363     9363           
Impacted Files Coverage Δ
monkey/common/utils/file_utils.py 100.00% <100.00%> (ø)
.../infection_monkey/ransomware/ransomware_payload.py 94.80% <100.00%> (ø)
monkey/monkey_island/cc/server_utils/consts.py 92.85% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ed2145...ae76872. Read the comment docs.

DEFAULT_SERVER_CONFIG_PATH = expand_path(
os.path.join(MONKEY_ISLAND_ABS_PATH, "cc", SERVER_CONFIG_FILENAME)
)
DEFAULT_SERVER_CONFIG_PATH = str(Path(MONKEY_ISLAND_ABS_PATH, "cc", SERVER_CONFIG_FILENAME))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why convert this back to string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I'm trying to limit the scope of this refactor. DEFAULT_SERVER_CONFIG_PATH was a string before, and now it still is.
  2. This is an established pattern within this file:
    DEFAULT_CRT_PATH = str(Path(MONKEY_ISLAND_ABS_PATH, "cc", "server.crt"))
    DEFAULT_KEY_PATH = str(Path(MONKEY_ISLAND_ABS_PATH, "cc", "server.key"))

Changing these constants from strings to Path objects should be done in a different PR.

@mssalvatore mssalvatore force-pushed the expand-path-returns-path branch from 3880b35 to ae76872 Compare July 7, 2021 22:51
@mssalvatore mssalvatore merged commit 0db85ae into develop Jul 7, 2021
@mssalvatore mssalvatore deleted the expand-path-returns-path branch July 29, 2021 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants