]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2049] hammer.py: create YANG repository
authorAndrei Pavel <andrei@isc.org>
Sat, 18 Sep 2021 07:10:01 +0000 (10:10 +0300)
committerAndrei Pavel <andrei@isc.org>
Fri, 22 Oct 2021 11:11:49 +0000 (11:11 +0000)
hammer.py

index e2b4351911de611a67d64fdb9f0e6d4b8a47fabd..20ec5619f548bf25216d9985d709b0cac93ed733 100755 (executable)
--- a/hammer.py
+++ b/hammer.py
@@ -1052,6 +1052,11 @@ def _install_sysrepo_from_sources():
         # right version pair to the dictionary above.
         sysrepo_version = '1.4.140'
 
+    # Create repository for YANG modules and change ownership to current user.
+    # pw usershow command is for BSD OSs.
+    execute('sudo mkdir -p /etc/sysrepo')
+    execute('sudo chown -R "${USER}:$(stat -c %G "${HOME}" || pw usershow ${USER} | cut -d ":" -f 9)" /etc/sysrepo')
+
     execute('rm -rf /tmp/sysrepo')
     try:
         execute('git clone https://github.com/sysrepo/sysrepo.git /tmp/sysrepo')