diff options
-rw-r--r-- | .github/workflows/check-open-prs-conflict.yml | 17 | ||||
-rw-r--r-- | .github/workflows/cla-check.yml | 19 | ||||
-rw-r--r-- | CODEOWNERS | 2 | ||||
-rw-r--r-- | debian/control | 3 | ||||
-rw-r--r-- | functions/interpreter/vyatta-cfg-run | 70 |
5 files changed, 88 insertions, 23 deletions
diff --git a/.github/workflows/check-open-prs-conflict.yml b/.github/workflows/check-open-prs-conflict.yml new file mode 100644 index 0000000..52b1193 --- /dev/null +++ b/.github/workflows/check-open-prs-conflict.yml @@ -0,0 +1,17 @@ +name: "Open PRs Conflicts checker" +on: + push: + branches: + - current + - sagitta + - circinus + workflow_dispatch: + +permissions: + contents: read + pull-requests: write + +jobs: + check-pr-conflict-call: + uses: vyos/.github/.github/workflows/check-open-prs-conflict.yml@current + secrets: inherit diff --git a/.github/workflows/cla-check.yml b/.github/workflows/cla-check.yml new file mode 100644 index 0000000..3c1aeee --- /dev/null +++ b/.github/workflows/cla-check.yml @@ -0,0 +1,19 @@ +name: "CLA Check" + +permissions: + actions: write + contents: read + pull-requests: write + statuses: write + +on: + pull_request: + types: [opened, synchronize, closed] + issue_comment: + types: [created] + +jobs: + call-cla-assistant: + uses: vyos/vyos-cla-signatures/.github/workflows/cla-reusable.yml@current + secrets: + CLA_PAT: ${{ secrets.CLA_PAT }} @@ -1 +1 @@ -* @vyos/reviewers
\ No newline at end of file +# * @vyos/reviewers
\ No newline at end of file diff --git a/debian/control b/debian/control index 136b2e8..0655d78 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,8 @@ Architecture: any Depends: sed (>= 4.1.5), procps (>= 1:3.2.7-3), coreutils (>= 5.97-5.3), - vyatta-bash | bash (>= 4.1), + vyatta-bash (>= 4.1), + bash-completion (= 1:2.8-6), bsdutils (>=1:2.13), libvyatta-cfg1 (>=${binary:Version}), unionfs-fuse, diff --git a/functions/interpreter/vyatta-cfg-run b/functions/interpreter/vyatta-cfg-run index d1dbd51..dc69d6c 100644 --- a/functions/interpreter/vyatta-cfg-run +++ b/functions/interpreter/vyatta-cfg-run @@ -103,39 +103,59 @@ vyatta_config_show () vyatta_config_commit () { - if ! vyatta_cli_shell_api sessionChanged; then - echo "No configuration changes to commit" - return 1; + if test -f "/var/run/vyconf_backend"; then + echo $$ + if ! /usr/libexec/vyos/vyconf/bin/vy_session_changed; then + echo "No configuration changes to commit" + return 1; + fi + else + if ! vyatta_cli_shell_api sessionChanged; then + echo "No configuration changes to commit" + return 1; + fi fi + local comment="commit" - local next=0 - local -a args=() - for arg in "$@"; do - if [ "$next" == "1" ]; then - comment=$arg - next=0; - elif [ "$arg" == "comment" ]; then - next=1 - elif [ "$arg" == "confirm" ]; then - echo Use commit-confirm command + if [ $# -gt 0 ] ; then + if [ $# = 1 ] || [ $# -gt 2 ] || [ "$1" != "comment" ]; then + if [ "$1" == "confirm" ]; then + echo "Use commit-confirm command" + return 1 + fi + echo "Error: commit accepts either no arguments, or optional 'comment'" \ + "with comment text as second argument." + echo -e "\tUsage: 'commit [comment COMMENTTEXT]'" return 1; - else - args[${#args[@]}]="$arg" fi - done + comment="$2" + fi export COMMIT_COMMENT="$comment" export COMMIT_VIA=cli - /opt/vyatta/sbin/my_commit "${args[@]}" 2>&1 + if test -f "/var/run/vyconf_backend"; then + /usr/libexec/vyos/vyconf/bin/vy_commit 2>&1 + else + /opt/vyatta/sbin/my_commit 2>&1 + fi unset COMMIT_VIA unset COMMIT_COMMENT + eval "${vyos_libexec_dir}/reset_section.py vpp --pid $$" } vyatta_config_commit-confirm () { - if ! vyatta_cli_shell_api sessionChanged; then - echo "No configuration changes to commit" - return 1; + if test -f "/var/run/vyconf_backend"; then + echo $$ + if ! /usr/libexec/vyos/vyconf/bin/vy_session_changed; then + echo "No configuration changes to commit" + return 1; + fi + else + if ! vyatta_cli_shell_api sessionChanged; then + echo "No configuration changes to commit" + return 1; + fi fi local -a args=() local first=1 @@ -285,6 +305,10 @@ up () really_exit() { + if test -f "/var/run/vyconf_backend"; then + local exit_cmd="${vyos_libexec_dir}/teardown-config-session.py $$" + eval "sudo sg vyattacfg \"$exit_cmd\"" + fi if vyatta_cli_shell_api sessionUnsaved; then echo "Warning: configuration changes have not been saved." @@ -354,7 +378,11 @@ vyatta_cfg_cmd_run () elif [[ "$cmd" == "show" ]]; then vyatta_config_show "${@:2}" else - cmd="/opt/vyatta/sbin/my_$cmd" + if test -f "/var/run/vyconf_backend"; then + cmd="${vyconf_bin_dir}/vy_$cmd" + else + cmd="/opt/vyatta/sbin/my_$cmd" + fi output=$($cmd "${@:2}") fi vyatta_cfg_print_output "$output" |