Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
name: Bug Report
about: Report a reproducible bug to help us improve JSNAPy
title: "[BUG] "
labels: bug
assignees: ''
---

## Description
A clear and concise description of the bug.

## Steps to Reproduce
1.
2.
3.

## Expected Behavior
What you expected to happen.

## Actual Behavior
What actually happened. Include any error messages or stack traces.

```
<paste error output here>
```

## Environment

| Item | Details |
|------------------|---------|
| JSNAPy version (`jsnapy --version`) | |
| Python version | |
| Operating System | |
| Junos OS version | |
| Device model | |
| Install method | pip / source / Docker |

## Configuration Files

<details>
<summary>JSNAPy config YAML (redact credentials)</summary>

```yaml

```
</details>

<details>
<summary>Test YAML file</summary>

```yaml

```
</details>

<details>
<summary>Snapshot XML (if relevant)</summary>

```xml

```
</details>

## Additional Context
Add any other context, screenshots, or links to related issues here.

## Checklist
- [ ] I searched [existing issues](https://github.com/Juniper/jsnapy/issues) and this is not a duplicate
- [ ] I reproduced the issue on the latest release or `master` branch
- [ ] I have included all relevant config/test files (with credentials redacted)
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Report a Security Vulnerability
url: https://github.com/Juniper/jsnapy/security/advisories/new
about: Please report security vulnerabilities privately. Do NOT open a public issue for security bugs.
- name: JSNAPy Wiki & Documentation
url: https://github.com/Juniper/jsnapy/wiki
about: Check the wiki before opening an issue — your question may already be answered.
- name: GitHub Community Support
url: https://github.com/orgs/community/discussions
about: For general GitHub usage questions, ask the community here.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Feature Request
about: Suggest a new feature or enhancement for JSNAPy
title: "[FEATURE] "
labels: enhancement
assignees: ''
---

## Summary
A clear and concise description of the feature you are requesting.

## Problem / Motivation
Describe the problem this feature would solve, or the use case that motivates the request.
_(e.g. "I find it difficult to ... when ...")_

## Proposed Solution
Describe the solution you'd like. Include any new YAML keys, CLI flags, Python API changes, or behaviour you envision.

```yaml
# Example config / usage snippet (if applicable)
```

## Alternatives Considered
List any alternative solutions or workarounds you have already tried or considered, and why they are insufficient.

## Additional Context
- Links to related issues, PRs, or discussions
- Reference to relevant Junos RPC / operational commands (if applicable)
- Any other context or screenshots

## Checklist
- [ ] I searched [existing issues](https://github.com/Juniper/jsnapy/issues) and this is not already requested
- [ ] I checked the [JSNAPy wiki](https://github.com/Juniper/jsnapy/wiki) and this is not already supported
- [ ] I am willing to submit a pull request to implement this feature
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Task
about: Describe a task, chore, or maintenance work to be done in JSNAPy
title: "[TASK] "
labels: task
assignees: ''
---

## Summary
A clear and concise description of the task to be completed.

## Background / Motivation
Explain why this task is needed (e.g. technical debt, CI improvement, dependency upgrade, documentation update).

## Acceptance Criteria
List the specific conditions that must be met for this task to be considered done.

- [ ]
- [ ]
- [ ]

## Implementation Notes
Any technical details, constraints, or approach suggestions relevant to completing the task.

## Sub-tasks
Break down the work into smaller steps if applicable.

- [ ]
- [ ]

## Related Issues / PRs
Link any related issues, pull requests, or discussions.

## Additional Context
Add any other context, references, or screenshots here.

## Checklist
- [ ] I searched [existing issues](https://github.com/Juniper/jsnapy/issues) and this task is not already tracked
- [ ] Acceptance criteria are clearly defined above
- [ ] I am willing to submit a pull request for this task
84 changes: 84 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
## Description

<!-- A concise summary of the changes in this PR. Reference related issues where applicable. -->

Closes #<!-- issue number -->

## Type of Change

<!-- Check all that apply -->

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] Feature / Enhancement (non-breaking change that adds functionality)
- [ ] Task / Chore (refactor, dependency update, CI, docs, etc.)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Changes Made

<!-- List the key changes introduced by this PR -->

-
-
-

---

## Checklist

### Code Quality

- [ ] Code follows the project's style guidelines
- [ ] `pylint` reports no new errors or warnings (run against changed files under `lib/jnpr/jsnapy/`)

```bash
sudo find ./lib/jnpr/jsnapy -type f -name "*.py" | xargs pylint | grep .
```

- [ ] `black` formatting check passes

```bash
black --check --diff --exclude="docs|build|tests|samples|venv" .
```

### Unit Tests

- [ ] New or updated unit tests have been added under `tests/unit/`
- [ ] All unit tests pass locally

```bash
cd tests/unit
nose2 --with-coverage -vvvv
```

- [ ] Code coverage has not decreased

### Documentation

- [ ] YAML samples in `samples/` updated or added where applicable
- [ ] `README.md` or wiki references updated (if behaviour changed)

### General

- [ ] No hardcoded credentials, IPs, or sensitive data introduced
- [ ] `requirements.txt` / `development.txt` updated (if new packages were added)
- [ ] I have read [CONTRIBUTING.md](../CONTRIBUTING.md) and my contribution complies with the Apache 2.0 License

---

## Testing Matrix

<!-- Confirm which Python versions and OS combinations you tested locally -->

| Python | OS | Pylint | Black | Unit Tests |
|---------|---------------|--------|-------|------------|
| 3.8.x | ubuntu-latest | [ ] | [ ] | [ ] |
| 3.9.x | ubuntu-latest | [ ] | [ ] | [ ] |
| 3.10.x | ubuntu-latest | [ ] | [ ] | [ ] |
| 3.11.x | ubuntu-latest | [ ] | [ ] | [ ] |
| 3.12.x | ubuntu-latest | [ ] | [ ] | [ ] |

---

## Additional Notes

<!-- Anything else reviewers should know: deployment considerations, follow-up tasks, known limitations, etc. -->
14 changes: 14 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Security Policy

## Supported Versions

Only the latest stable version of JSNAPy receives security updates. Make sure you are running the most recent release.

## Reporting a Vulnerability

Please do not open public issues for security problems. Instead, use GitHub's "Report a vulnerability" feature in the Security tab of this repository. We will review and respond as soon as possible.

## Security Updates

If we fix a vulnerability, we will announce it in the release notes. Keep your installation up to date to receive the latest fixes.

6 changes: 3 additions & 3 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
python-version: [3.8.12, 3.9.12, 3.10.12, 3.11.9, 3.12.4]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Validate version
Expand All @@ -46,7 +46,7 @@ jobs:
cd ../
tar -xzvf jsnapy-*.tar.gz
cd jsnapy-1.3.8
python setup.py install
pip install .


- name: Analysing the code with pylint
Expand Down
22 changes: 9 additions & 13 deletions lib/jnpr/jsnapy/jsnapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def __init__(self):
self.test_cases = None
self.parser = argparse.ArgumentParser(
formatter_class=argparse.RawTextHelpFormatter,
description=textwrap.dedent(
"""\
description=textwrap.dedent("""\
Tool to capture snapshots and compare them
It supports four subcommands:
--snap, --check, --snapcheck, --diff
Expand All @@ -64,8 +63,7 @@ def __init__(self):
jsnapy --snapcheck snapfile -f main_configfile
4. Take diff without specifying test case:
jsnapy --diff pre_snapfile post_snapfile -f main_configfile
"""
),
"""),
usage="\nThis tool enables you to capture and audit runtime environment of "
"\nnetworked devices running the Junos operating system (Junos OS)\n",
)
Expand Down Expand Up @@ -139,15 +137,13 @@ def __init__(self):
"-v",
"--verbosity",
action="count",
help=textwrap.dedent(
"""\
help=textwrap.dedent("""\
Set verbosity
-v: Debug level messages
-vv: Info level messages
-vvv: Warning level messages
-vvvv: Error level messages
-vvvvv: Critical level messages"""
),
-vvvvv: Critical level messages"""),
)
# self.parser.add_argument(
# "-m",
Expand Down Expand Up @@ -426,7 +422,7 @@ def compare_tests(
pre_snap=None,
post_snap=None,
action=None,
**kwargs
**kwargs,
):
"""
called by check and snapcheck argument, to compare snap files
Expand Down Expand Up @@ -617,7 +613,7 @@ def connect(
config_data=None,
action=None,
post_snap=None,
**kwargs
**kwargs,
):
"""
connect to device and calls the function either to generate snapshots
Expand Down Expand Up @@ -661,7 +657,7 @@ def connect(
user=username,
passwd=password,
gather_facts=False,
**kwargs
**kwargs,
)
try:
dev.open()
Expand All @@ -678,7 +674,7 @@ def connect(
config_data,
action,
post_snap,
**kwargs
**kwargs,
)
else:
self.logger.error(
Expand Down Expand Up @@ -996,7 +992,7 @@ def check_arguments(self):
# then it should print error message.
if not (
(self.args.file is None)
and ((self.args.testfiles is None or self.args.hostname is None))
and (self.args.testfiles is None or self.args.hostname is None)
):
action = None
if self.set_action_cmd(action) is not None:
Expand Down
4 changes: 2 additions & 2 deletions lib/jnpr/jsnapy/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def define_operator(
iter,
id,
test_name,
*args
*args,
):
"""
It will call functions according to test operator
Expand Down Expand Up @@ -82,7 +82,7 @@ def define_operator(
iter,
id,
test_name,
*args
*args,
)
except AttributeError as e:
self.logger_testop.error(
Expand Down
Loading
Loading