-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diagram class related to #127 #135
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run pylint on your python code and fix issues.
************* Module test
test.py:1:0: C0114: Missing module docstring (missing-module-docstring)
test.py:12:0: C0115: Missing class docstring (missing-class-docstring)
test.py:60:12: W0106: Expression "val1['obj'] >> Edge(label=self.d_LinkLabel(val1, val2)) << val2['obj']" is assigned to nothing (expression-not-assigned)
test.py:69:35: R1733: Unnecessary dictionary index lookup, use 'vals' instead (unnecessary-dict-index-lookup)
test.py:74:39: R1733: Unnecessary dictionary index lookup, use 'vals' instead (unnecessary-dict-index-lookup)
test.py:79:39: R1733: Unnecessary dictionary index lookup, use 'vals' instead (unnecessary-dict-index-lookup)
test.py:81:4: C0116: Missing function or method docstring (missing-function-docstring)
test.py:94:4: C0116: Missing function or method docstring (missing-function-docstring)
test.py:94:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
test.py:108:4: C0116: Missing function or method docstring (missing-function-docstring)
test.py:108:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
test.py:117:4: C0116: Missing function or method docstring (missing-function-docstring)
test.py:125:4: C0116: Missing function or method docstring (missing-function-docstring)
test.py:126:38: C0121: Comparison 'self.popreverse == None' should be 'self.popreverse is None' (singleton-comparison)
test.py:128:40: C0121: Comparison 'self.popreverse == False' should be 'self.popreverse is False' if checking for the singleton value False, or 'not self.popreverse' if testing for falsiness (singleton-comparison)
test.py:130:40: C0121: Comparison 'self.popreverse == True' should be 'self.popreverse is True' if checking for the singleton value True, or 'bool(self.popreverse)' if testing for truthiness (singleton-comparison)
test.py:133:4: C0116: Missing function or method docstring (missing-function-docstring)
test.py:140:19: R1714: Consider merging these comparisons with 'in' by using 'self.popreverse in (None, False)'. Use a set instead if elements are hashable. (consider-using-in)
test.py:140:19: C0121: Comparison 'self.popreverse == None' should be 'self.popreverse is None' (singleton-comparison)
test.py:140:46: C0121: Comparison 'self.popreverse == False' should be 'self.popreverse is False' if checking for the singleton value False, or 'not self.popreverse' if testing for falsiness (singleton-comparison)
test.py:142:21: C0121: Comparison 'self.popreverse == True' should be 'self.popreverse is True' if checking for the singleton value True, or 'self.popreverse' if testing for truthiness (singleton-comparison)
------------------------------------------------------------------
Your code has been rated at 8.26/10 (previous run: 6.03/10, +2.23)
for rcfile - use this one: https://github.com/sdn-sense/siterm/blob/master/standarts/pylintrc (We should also upload rcfile to this repo too)
Looks all good, one thing which is still missing is: You can see mermaid example here: https://autogole-grafana.nrp-nautilus.io/d/3634ecaa-6a1b-55d5-6464-292f22be058e/sc23-rucio-dmm-fnal-ucsd-flow-c33a01c3-e94f-4d4f-be7f-97bb1114bf10-2024-10-02-01-16-35-justas-dev?orgId=1 So it needs to include BGP information also to diagrams diagram. |
@juztas I added the BGP |
I see no bgp added |
#Generate Diagrams | ||
try: | ||
diagram_filename = f"{self.config.get('image_dir', '/srv/images')}/diagram_{kwargs['referenceUUID']}" | ||
DiagramWorker(self.orderlist).createGraph(diagram_filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use class inheritance, same as we do for templates and other classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
Idk what happened (base) sunami@Sunamis-MacBook-Pro packaging % git status
On branch imageserver
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: files/etc/grid-security/hostcert.pem
modified: files/etc/grid-security/hostkey.pem
modified: files/etc/rtmon.yaml
modified: files/etc/sense-o-auth.yaml
modified: start-dev.sh
modified: ../src/python/RTMonLibs/DiagramWorker.py
modified: ../src/python/RTMonLibs/imageserver.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
diagram.png
diagram2.png
../src/python/RTMonLibs/__pycache__/
no changes added to commit (use "git add" and/or "git commit -a")
(base) sunami@Sunamis-MacBook-Pro packaging % git add ../src/python/RTMonLibs/DiagramWorker.py
(base) sunami@Sunamis-MacBook-Pro packaging % git add ../src/python/RTMonLibs/DiagramWorker.py
(base) sunami@Sunamis-MacBook-Pro packaging % git commit -m "Added BGP"
[imageserver b6fd690] Added BGP
Committer: Sunami Dasgupta <[email protected]>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email [email protected]
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 file changed, 43 insertions(+)
(base) sunami@Sunamis-MacBook-Pro packaging % git push origin diagram-branch
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To https://github.com/esnet/sense-rtmon/
f1fcc5d..98e18f4 diagram-branch -> diagram-branch
(base) sunami@Sunamis-MacBook-Pro packaging % git status
On branch imageserver
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: files/etc/grid-security/hostcert.pem
modified: files/etc/grid-security/hostkey.pem
modified: files/etc/rtmon.yaml
modified: files/etc/sense-o-auth.yaml
modified: start-dev.sh
modified: ../src/python/RTMonLibs/imageserver.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
diagram.png
diagram2.png
../src/python/RTMonLibs/__pycache__/
no changes added to commit (use "git add" and/or "git commit -a")
(base) sunami@Sunamis-MacBook-Pro packaging %
|
Based on output:
|
Oh Got it |
graphviz
to the list of installed dependenciesdiagrams
package.host.png
,switch.png
) in/srv/icons/
for use in the diagram generation.DiagramWorker
class inRTMonLibs/DiagramWorker.py
responsible for generating network topology diagrams using thediagrams
package.worker.py
to delete generated diagram images when executions are deleted.DiagramWorker
into the template creation process/srv/images
with a unique reference ID for easy tracking.