Merge "Add Salt 2018.3 tests"
diff --git a/README.rst b/README.rst
index ce7c1d9..6c47157 100644
--- a/README.rst
+++ b/README.rst
@@ -60,7 +60,7 @@
         full_backups_to_keep: 3
         incr_before_full: 3
         backup_times:
-          dayOfWeek: 0
+          day_of_week: 0
           hour: 4
           minute: 52
         compression: true
@@ -77,7 +77,7 @@
   ``backup_times`` parameters is not defined, the defalut ``*`` value will be
   used. For example, if minute parameter is ``*``, it will run the backup every minute,
   which is ususally not desired.
-  Available parameters are ``dayOfWeek``, ``dayOfMonth``, ``month``, ``hour`` and ``minute``.
+  Available parameters are ``day_of_week``, ``day_of_month``, ``month``, ``hour`` and ``minute``.
   Please see the crontab reference for further info on how to set these parameters.
 
   .. note:: Please be aware that only ``backup_times`` section OR
@@ -124,7 +124,7 @@
         incr_before_full: 3
         backup_dir: /srv/backup
         backup_times:
-          dayOfWeek: 0
+          day_of_week: 0
           hour: 4
           minute: 52
         key:
@@ -138,7 +138,7 @@
   ``backup_times`` parameters is not defined, the defalut ``*`` value will be
   used. For example, if minute parameter is ``*``, it will run the backup every minute,
   which is ususally not desired.
-  Available parameters are ``dayOfWeek``, ``dayOfMonth``, ``month``, ``hour`` and ``minute``.
+  Available parameters are ``day_of_week``, ``day_of_month``, ``month``, ``hour`` and ``minute``.
   Please see the crontab reference for further info on how to set these parameters.
 
   .. note:: Please be aware that only ``backup_times`` section OR
diff --git a/cassandra/backup.sls b/cassandra/backup.sls
index fd1cacd..947fb5d 100644
--- a/cassandra/backup.sls
+++ b/cassandra/backup.sls
@@ -49,14 +49,14 @@
   - name: /usr/local/bin/cassandra-backup-runner-call.sh
   - user: root
 {%- if backup.client.backup_times is defined %}
-{%- if backup.client.backup_times.dayOfWeek is defined %}
-  - dayweek: {{ backup.client.backup_times.dayOfWeek }}
+{%- if backup.client.backup_times.day_of_week is defined %}
+  - dayweek: {{ backup.client.backup_times.day_of_week }}
 {%- endif -%}
 {%- if backup.client.backup_times.month is defined %}
   - month: {{ backup.client.backup_times.month }}
 {%- endif %}
-{%- if backup.client.backup_times.dayOfMonth is defined %}
-  - daymonth: {{ backup.client.backup_times.dayOfMonth }}
+{%- if backup.client.backup_times.day_of_month is defined %}
+  - daymonth: {{ backup.client.backup_times.day_of_month }}
 {%- endif %}
 {%- if backup.client.backup_times.hour is defined %}
   - hour: {{ backup.client.backup_times.hour }}
diff --git a/cassandra/files/backup/cassandra-backup-client-restore-call.sh b/cassandra/files/backup/cassandra-backup-client-restore-call.sh
index f7bf241..3dbc109 100644
--- a/cassandra/files/backup/cassandra-backup-client-restore-call.sh
+++ b/cassandra/files/backup/cassandra-backup-client-restore-call.sh
@@ -67,21 +67,17 @@
 
 echo "Restoring db from $FULLBACKUPDIR/$FULL/"
 for filename in $FULLBACKUPDIR/$FULL/*; do $SCRIPTDIR/cassandra-backup-restore.sh -f $filename; done
-RC=$?
-if [ $RC -eq 0 ]; then
-    nodetool repair
-    touch $DBALREADYRESTORED
-fi
 
 {%- else %}
 
 FULL=`find $BACKUPDIR -mindepth 1 -maxdepth 1 -type d -printf "%P\n" | sort -nr | head -{{ backup.client.restore_latest }} | tail -1`
 echo "Restoring db from $BACKUPDIR/$FULL/"
 for filename in $BACKUPDIR/$FULL/*; do $SCRIPTDIR/cassandra-backup-restore.sh -f $filename; done
-RC=$?
-if [ $RC -eq 0 ]; then
-    nodetool repair
-    touch $DBALREADYRESTORED
-fi
 
 {%- endif %}
+
+nodetool repair
+RC=$?
+if [ $RC -eq 0 ]; then
+    touch $DBALREADYRESTORED
+fi
diff --git a/cassandra/files/backup/cassandra-backup-client-runner-call.sh b/cassandra/files/backup/cassandra-backup-client-runner-call.sh
index be3580f..3ce2b5f 100644
--- a/cassandra/files/backup/cassandra-backup-client-runner-call.sh
+++ b/cassandra/files/backup/cassandra-backup-client-runner-call.sh
@@ -24,7 +24,7 @@
     DSECFG="/etc/dse/cassandra"
     CASCFG='/etc/cassandra/cassandra.yaml'
     BACKUPDIR="{{ backup.backup_dir }}/full"
-    SERVERBACKUPDIR="{{ backup.client.target.get('backup_dir', backup.backup_dir) }}"
+    SERVERBACKUPDIR="{{ backup.client.target.get('backup_dir', backup.backup_dir) }}/full"
     TMPDIR="$( pwd )/${PROGNAME}.tmp${RANDOM}"
     CLITMPFILE="${TMPDIR}/cqlschema"
     CASIP="127.0.0.1"
diff --git a/metadata.yml b/metadata.yml
index 5770491..0560ef4 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,3 +1,3 @@
 name: "cassandra"
 version: "0.1"
-source: "https://github.com/tcpcloud/salt-formula-cassandra"
+source: "https://github.com/salt-formulas/salt-formula-cassandra"
diff --git a/tests/pillar/backup_client_backup_times.sls b/tests/pillar/backup_client_backup_times.sls
index 6f0b43b..575b659 100644
--- a/tests/pillar/backup_client_backup_times.sls
+++ b/tests/pillar/backup_client_backup_times.sls
@@ -5,9 +5,9 @@
       full_backups_to_keep: 3
       incr_before_full: 3
       backup_times:
-        dayOfWeek: 0
+        day_of_week: 0
 #       month: *
-#       dayOfMonth: *
+#       day_of_month: *
         hour: 4
         minute: 52
       target:
diff --git a/tests/pillar/backup_server_backup_times.sls b/tests/pillar/backup_server_backup_times.sls
index 5c226b6..0d97827 100644
--- a/tests/pillar/backup_server_backup_times.sls
+++ b/tests/pillar/backup_server_backup_times.sls
@@ -6,9 +6,9 @@
       incr_before_full: 3
       backup_dir: /srv/backup
       backup_times:
-        dayOfWeek: 0
+        day_of_week: 0
 #       month: *
-#       dayOfMonth: *
+#       day_of_month: *
         hour: 4
         minute: 52
       key: