diff options
author | Instrumental <jonathan.gathman@att.com> | 2019-02-22 01:18:51 -0600 |
---|---|---|
committer | Instrumental <jonathan.gathman@att.com> | 2019-02-22 01:24:27 -0600 |
commit | f54a4aad8cdff00f2bbac984b1e98fb1add038be (patch) | |
tree | 2cfb8efaaf083441e67369b0461c9cf2956aff52 /auth | |
parent | 8da0163b75076832417ee9b255f63b4c789e3c12 (diff) |
Refine Local Agent.sh use
Issue-ID: AAF-770
Change-Id: Ic6593bde1e16db35cf538cb1d2caa152016f3a82
Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth')
-rw-r--r-- | auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java | 48 | ||||
-rw-r--r-- | auth/auth-cass/cass_init/config.dat | 9 | ||||
-rw-r--r-- | auth/auth-cass/docker/Dockerfile.cass | 2 | ||||
-rw-r--r-- | auth/docker/Dockerfile.base | 2 | ||||
-rw-r--r-- | auth/docker/agent.sh | 11 | ||||
-rw-r--r-- | auth/sample/cass_data/config.dat | 20 |
6 files changed, 44 insertions, 48 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java index 189857c9..bf73c1da 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java @@ -200,30 +200,34 @@ if(!identity.isPerson()) { identity = identity.responsibleTo(); } - for(int i=1;i<nb.escalation();++i) { - if(identity != null) { - if(i==1) { - toList.add(identity.email()); - } else { - identity=identity.responsibleTo(); - ccList.add(identity.email()); + if(identity==null) { + trans.warn().printf("Responsible Identity %s is invalid for this Organization. Skipping notification.",id); + } else { + for(int i=1;i<nb.escalation();++i) { + if(identity != null) { + if(i==1) { + toList.add(identity.email()); + } else { + identity=identity.responsibleTo(); + ccList.add(identity.email()); + } } } - } - - StringBuilder content = new StringBuilder(); - content.append(String.format(header,version,Identity.mixedCase(identity.firstName()))); - - nb.body(noAvg, content, indent, notify, id); - content.append(footer); - - if(mailer.sendEmail(noAvg, test, toList, ccList, subject,content.toString(), urgent)) { - nb.inc(); - } else { - trans.error().log("Mailer failed to send Mail"); - } - if(maxEmails>0 && nb.count()>=maxEmails) { - break ONE_EMAIL; + + StringBuilder content = new StringBuilder(); + content.append(String.format(header,version,Identity.mixedCase(identity.firstName()))); + + nb.body(noAvg, content, indent, notify, id); + content.append(footer); + + if(mailer.sendEmail(noAvg, test, toList, ccList, subject,content.toString(), urgent)) { + nb.inc(); + } else { + trans.error().log("Mailer failed to send Mail"); + } + if(maxEmails>0 && nb.count()>=maxEmails) { + break ONE_EMAIL; + } } } } catch (OrganizationException e) { diff --git a/auth/auth-cass/cass_init/config.dat b/auth/auth-cass/cass_init/config.dat deleted file mode 100644 index 0e705b92..00000000 --- a/auth/auth-cass/cass_init/config.dat +++ /dev/null @@ -1,9 +0,0 @@ -aaf|aaf_env|DEV
-aaf|cadi_x509_issuers|CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US
-aaf|aaf_oauth2_introspect_url|https://AAF_LOCATE_URL/AAF_NS.introspect:2.1/introspect
-aaf|aaf_oauth2_token_url|https://AAF_LOCATE_URL/AAF_NS.token:2.1/token
-aaf|aaf_url|https://AAF_LOCATE_URL/AAF_NS.service:2.1
-aaf|cadi_protocols|TLSv1.1,TLSv1.2
-aaf|cm_url|https://AAF_LOCATE_URL/AAF_NS.cm:2.1
-aaf|fs_url|https://AAF_LOCATE_URL/AAF_NS.fs.2.1
-aaf|gui_url|https://AAF_LOCATE_URL/AAF_NS.gui.2.1
diff --git a/auth/auth-cass/docker/Dockerfile.cass b/auth/auth-cass/docker/Dockerfile.cass index aa6a9efb..f842a962 100644 --- a/auth/auth-cass/docker/Dockerfile.cass +++ b/auth/auth-cass/docker/Dockerfile.cass @@ -17,7 +17,9 @@ # limitations under the License. # ============LICENSE_END==================================================== # +# public, multi-platform base image FROM nexus3.onap.org:10001/cassandra:3.11 +# FROM cassandra:3.11 MAINTAINER AAF Team, AT&T 2018 ENV VERSION=${AAF_VERSION} diff --git a/auth/docker/Dockerfile.base b/auth/docker/Dockerfile.base index af29b951..69627945 100644 --- a/auth/docker/Dockerfile.base +++ b/auth/docker/Dockerfile.base @@ -17,7 +17,9 @@ # limitations under the License. # ============LICENSE_END==================================================== # +# Use Public Image FROM nexus3.onap.org:10001/openjdk:8-jre-alpine +#FROM openjdk:8-jre-alpine MAINTAINER AAF Team, AT&T 2018 LABEL description="aaf_base" diff --git a/auth/docker/agent.sh b/auth/docker/agent.sh index 7e7d08c0..4be485b8 100644 --- a/auth/docker/agent.sh +++ b/auth/docker/agent.sh @@ -127,13 +127,13 @@ function run_it() { function sso { if [ -n "$2" ]; then - echo "$1=$2" >> ~/.aaf/sso.props + echo "$1=$2" >> $HOME/.aaf/sso.props fi } function reset_sso { mkdir -p ~/.aaf - > ~/.aaf/sso.props + > $HOME/.aaf/sso.props sso aaf_locate_url "https://$AAF_FQDN:8095" sso cadi_latitude "$LATITUDE" sso cadi_longitude "$LONGITUDE" @@ -160,9 +160,9 @@ case "$1" in shift reset_sso if [ -f aaf-auth-cmd-$VERSION*-full.jar ]; then - java -Dcadi_prop_files="~\/.aaf\/sso.props" -jar aaf-auth-cmd-$VERSION*-full.jar $@ + java -Dcadi_prop_files="$HOME/.aaf/sso.props" -jar aaf-auth-cmd-$VERSION*-full.jar $@ else - echo "For local use, you need to have 'aaf-cadi-aaf-$VERSION*-full.jar' (or newer)" + echo "For local use, you need to have 'aaf-auth-cmd-$VERSION*-full.jar' (or newer)" fi ;; local) @@ -186,8 +186,7 @@ case "$1" in sso aaf_id "$DEPLOY_FQI" sso aaf_password "$DEPLOY_PASSWORD" if [ -f aaf-auth-cmd-$VERSION*-full.jar ]; then - mkdir -p $APP_FQDN - java -Dcadi_prop_files="~\/.aaf\/sso.props" -cp aaf-auth-cmd-$VERSION*-full.jar org.onap.aaf.cadi.configure.Agent $CMD + java -Dcadi_prop_files="$HOME/.aaf/sso.props" -cp aaf-auth-cmd-$VERSION*-full.jar org.onap.aaf.cadi.configure.Agent $CMD else echo "For local use, you need to have 'aaf-cadi-aaf-$VERSION*-full.jar' (or newer)" fi diff --git a/auth/sample/cass_data/config.dat b/auth/sample/cass_data/config.dat index 46e57b40..606d23d4 100644 --- a/auth/sample/cass_data/config.dat +++ b/auth/sample/cass_data/config.dat @@ -1,11 +1,9 @@ -aaf|aaf_auth2_introspect_url|https://AAF_LOCATE_URL/%CNS%AAF_NS.introspect:2.1/introspect -aaf|aaf_auth2_token_url|https://AAF_LOCATE_URL/%CNS%AAF_NS.token:2.1/token -aaf|aaf_env|DEV -aaf|aaf_oauth2_introspect_url|https://AAF_LOCATE_URL/AAF_NS.introspect:2.1/introspect -aaf|aaf_oauth2_token_url|https://AAF_LOCATE_URL/AAF_NS.token:2.1/token -aaf|aaf_url|https://AAF_LOCATE_URL/%CNS%AAF_NS.service:2.1 -aaf|cadi_protocols|TLSv1.1,TLSv1.2 -aaf|cadi_x509_issuers|CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US -aaf|cm_url|https://AAF_LOCATE_URL/%CNS%AAF_NS.cm:2.1 -aaf|fs_url|https://AAF_LOCATE_URL/%CNS%AAF_NS.fs:2.1 -aaf|gui_url|https://AAF_LOCATE_URL/%CNS%AAF_NS.gui:2.1 +aaf|aaf_env|DEV
+aaf|aaf_oauth2_introspect_url|https://AAF_LOCATE_URL/%CNS.%AAF_NS.introspect:2.1/introspect
+aaf|aaf_oauth2_token_url|https://AAF_LOCATE_URL/%CNS.%AAF_NS.token:2.1/token
+aaf|aaf_url|https://AAF_LOCATE_URL/%CNS.%AAF_NS.service:2.1
+aaf|cadi_protocols|TLSv1.1,TLSv1.2
+aaf|cadi_x509_issuers|CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US
+aaf|cm_url|https://AAF_LOCATE_URL/%CNS.%AAF_NS.cm:2.1
+aaf|fs_url|https://AAF_LOCATE_URL/%CNS.%AAF_NS.fs:2.1
+aaf|gui_url|https://AAF_LOCATE_URL/%CNS.%AAF_NS.gui:2.1
|