openshift/origin-server — pull request #3687 by mmahut (2013-09-23 20:48:38+00:00)
Title: RHBZ#1005307 refactor oo-restorecon to accept files as arguments

Reworking the oo-restorecon script a little.

```
# oo-restorecon
Usage: /usr/sbin/oo-restorecon [options] [FILES]
-v, --verbose Verbose output
-a, --all Chcon all gears
-h, --help Display help
#
```
```
# oo-restorecon -a
#
```

```
# oo-restorecon -a -v
restorecon -R /var/lib/openshift/52409ecd6e6f0074b4000007/
chcon -l s0:c0,c1000 -R /var/lib/openshift/52409ecd6e6f0074b4000007//*
restorecon -R /var/lib/openshift/52409eea6e6f0074b4000020/
chcon -l s0:c0,c1001 -R /var/lib/openshift/52409eea6e6f0074b4000020//*
restorecon -R /var/lib/openshift/52409f086e6f0074b4000039/
chcon -l s0:c0,c1002 -R /var/lib/openshift/52409f086e6f0074b4000039//*
#
```

```
# oo-restorecon -v 52409ecd6e6f0074b4000007 52409eea6e6f0074b4000020
restorecon -R /var/lib/openshift/52409ecd6e6f0074b4000007/
chcon -l s0:c0,c1000 -R /var/lib/openshift/52409ecd6e6f0074b4000007//*
restorecon -R /var/lib/openshift/52409eea6e6f0074b4000020/
chcon -l s0:c0,c1001 -R /var/lib/openshift/52409eea6e6f0074b4000020//*
#
```

```
# oo-restorecon -v 52409ecd6e6f0074b4000007 52409eea6e6f0074b4000020 0000000000000000000000000000
restorecon -R /var/lib/openshift/52409ecd6e6f0074b4000007/
chcon -l s0:c0,c1000 -R /var/lib/openshift/52409ecd6e6f0074b4000007//*
restorecon -R /var/lib/openshift/52409eea6e6f0074b4000020/
chcon -l s0:c0,c1001 -R /var/lib/openshift/52409eea6e6f0074b4000020//*
ERROR: Gear 0000000000000000000000000000 does not exist!
#
```

Reference https://bugzilla.redhat.com/show_bug.cgi?id=1005307