Skip to content

Commit

Permalink
Merge pull request #297 from pilou-/allow_non_root_user_to_install
Browse files Browse the repository at this point in the history
Allow non-root users to install Lago using pip
  • Loading branch information
lago-bot authored Oct 15, 2016
2 parents 4187830 + be39633 commit 48ec964
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
18 changes: 15 additions & 3 deletions lago.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,22 @@ install -d -m 755 %{buildroot}/%{_sysconfdir}/lago
PYTHONPATH="$PYTHONPATH:%{buildroot}/%{python_sitelib}"\
%{buildroot}/usr/bin/lago --ignore-warnings generate-config > "%{buildroot}/%{_sysconfdir}/lago/lago.conf"
sed -i 's/^\([^#]\)\(.*\)/#\0/' "%{buildroot}/%{_sysconfdir}/lago/lago.conf"
chmod 0644 "%{buildroot}/%{_sysconfdir}/lago/lago.conf"

install -d %{buildroot}/var/lib/lago/subnets
install -d %{buildroot}/var/lib/lago/store
install -d %{buildroot}/var/lib/lago/repos

install -d -m 755 %{buildroot}%{_sysconfdir}/polkit-1/localauthority/50-local.d
install -d -m 755 %{buildroot}%{_sysconfdir}/sudoers.d

install -p -D -m 644 etc/polkit/*.pkla %{buildroot}%{_sysconfdir}/polkit-1/localauthority/50-local.d/
install -p -D -m 644 etc/sudo/* %{buildroot}%{_sysconfdir}/sudoers.d/

# this is for python-lago-ovirt
install -d %{buildroot}/var/lib/lago/reposync
install -d -m 755 %{buildroot}%{_sysconfdir}/firewalld/services
install -p -D -m 644 etc/firewalld/services/* %{buildroot}%{_sysconfdir}/firewalld/services/

%files

Expand Down Expand Up @@ -104,11 +114,13 @@ Requires: sudo
%{python2_sitelib}/%{name}_template_repo/*.py*
%{python2_sitelib}/%{name}/*.xml
%{python2_sitelib}/%{name}-%{version}-py*.egg-info
%{_sysconfdir}/polkit-1/localauthority/50-local.d/
%{_bindir}/lagocli
%{_bindir}/lago
%attr(0775, root, root) %{_sysconfdir}/sudoers.d/*

%config(noreplace) %{_sysconfdir}/lago/lago.conf
%config(noreplace) %{_sysconfdir}/polkit-1/localauthority/50-local.d/*
%config(noreplace) %{_sysconfdir}/sudoers.d/*

%dir %attr(2775, root, lago) /var/lib/lago/
%dir %attr(2775, root, lago) /var/lib/lago/subnets/
%dir %attr(2775, root, lago) /var/lib/lago/store/
Expand Down Expand Up @@ -159,7 +171,7 @@ Requires: xz

%files -n python-%{name}-ovirt
%{python2_sitelib}/ovirt%{name}/*.py*
%{_sysconfdir}/firewalld/services/*
%config(noreplace) %{_sysconfdir}/firewalld/services/*
%dir %attr(2775, root, lago) /var/lib/lago/reposync/

%post -n python-%{name}-ovirt
Expand Down
6 changes: 0 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ packages =
lago.plugins
lago_template_repo
ovirtlago
data_files =
# core lago
/etc/sudoers.d/ = etc/sudo/lago
/etc/polkit-1/localauthority/50-local.d = etc/polkit/*
# ovirt lago plugin
/etc/firewalld/services = etc/firewalld/services/*

[flake8]
# ignore line break before operator
Expand Down

0 comments on commit 48ec964

Please sign in to comment.