Skip to content

Commit

Permalink
Fix typos in database modules and their integration tests (#62125) (#…
Browse files Browse the repository at this point in the history
…62172)

(cherry picked from commit bcc3620)
  • Loading branch information
Andersson007 authored and acozine committed Sep 12, 2019
1 parent 5bcc1b6 commit 80c39bd
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 41 deletions.
Expand Up @@ -266,7 +266,7 @@ def _create_client(self):
return aerospike.client(config)

def _info_cmd_helper(self, cmd, node=None, delimiter=';'):
"""delimiter is for seperate stats that come back, NOT for kv
"""delimiter is for separate stats that come back, NOT for kv
separation which is ="""
if node is None: # If no node passed, use the first one (local)
node = self._nodes[0]
Expand Down Expand Up @@ -316,7 +316,7 @@ def _can_use_cluster_stable(self):
def _update_cluster_namespace_list(self):
""" make a unique list of namespaces
TODO: does this work on a rolling namespace add/deletion?
thankfully if it doesnt, we dont need this on builds >=4.3"""
thankfully if it doesn't, we dont need this on builds >=4.3"""
self._namespaces = set()
for node in self._nodes:
namespaces = self._info_cmd_helper('namespaces', node)
Expand Down Expand Up @@ -418,7 +418,7 @@ def _local_node_has_migs(self):

def _is_min_cluster_size(self):
"""checks that all nodes in the cluster are returning the
mininimum cluster size specified in their statistics output"""
minimum cluster size specified in their statistics output"""
sizes = set()
for node in self._cluster_statistics:
sizes.add(int(self._cluster_statistics[node]['cluster_size']))
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/modules/database/mongodb/mongodb_user.py
Expand Up @@ -150,7 +150,7 @@
state: present
# add a user 'oplog_reader' with read only access to the 'local' database on the replica_set 'belcher'. This is useful for oplog access (MONGO_OPLOG_URL).
# please notice the credentials must be added to the 'admin' database because the 'local' database is not syncronized and can't receive user credentials
# please notice the credentials must be added to the 'admin' database because the 'local' database is not synchronized and can't receive user credentials
# To login with such user, the connection string should be MONGO_OPLOG_URL="mongodb://oplog_reader:oplog_reader_password@server1,server2/local?authSource=admin"
# This syntax requires mongodb 2.6+ and pymongo 2.5+
- mongodb_user:
Expand Down
Expand Up @@ -59,7 +59,7 @@
is 1000.
max_replication_lag:
description:
- If greater than 0, ProxySQL will reguarly monitor replication lag. If
- If greater than 0, ProxySQL will regularly monitor replication lag. If
replication lag goes above I(max_replication_lag), proxysql will
temporarily shun the server until replication catches up. If omitted
the proxysql database default for I(max_replication_lag) is 0.
Expand Down
Expand Up @@ -53,7 +53,7 @@

RETURN = '''
stdout:
description: Returns the mysql variable supplied with it's associted value.
description: Returns the mysql variable supplied with it's associated value.
returned: Returns the current variable and value, or the newly set value
for the variable supplied..
type: dict
Expand Down
Expand Up @@ -30,7 +30,7 @@
required: True
comment:
description:
- Text field that can be used for any purposed defined by the user.
- Text field that can be used for any purposes defined by the user.
state:
description:
- When C(present) - adds the replication hostgroup, when C(absent) -
Expand Down
Expand Up @@ -157,7 +157,7 @@
# I couldn't check it for two or more extension in one time
# because most of the common extensions are available in postgresql-contrib package
# that tries to change the default python interpreter and fails during tests respectively.
# Anyway, that's enough to be sure that the proper SQL was exequted.
# Anyway, that's enough to be sure that the proper SQL was executed.
#

# Drop extension cascade
Expand Down
4 changes: 2 additions & 2 deletions test/integration/targets/postgresql/tasks/postgresql_idx.yml
Expand Up @@ -253,7 +253,7 @@
- result.schema == 'public'
- result.query == 'CREATE INDEX CONCURRENTLY test1_idx ON public.test_table USING BTREE (id) WHERE id > 1 AND id != 10'

# Drop index from spacific schema with cascade in check_mode
# Drop index from specific schema with cascade in check_mode
- name: postgresql_idx - drop index from specific schema cascade in check_mode
become_user: "{{ pg_user }}"
become: yes
Expand Down Expand Up @@ -295,7 +295,7 @@
- result.rowcount == 1
when: tablespace.rc == 0

# Drop index from spacific schema with cascade
# Drop index from specific schema with cascade
- name: postgresql_idx - drop index from specific schema cascade
become_user: "{{ pg_user }}"
become: yes
Expand Down
Expand Up @@ -93,7 +93,7 @@
- result.state == "present"
- result.target_roles == ["user1"]

# Grant group1 to user1 againt to check that nothing changes:
# Grant group1 to user1 again to check that nothing changes:
- name: postgresql_membership - grant group1 to user1 again
become_user: "{{ pg_user }}"
become: yes
Expand Down
Expand Up @@ -776,7 +776,7 @@
- result.rowcount == 1

# true mode obj_type: view again
- name: postgresql_owner - set vatview owner again
- name: postgresql_owner - set view owner again
become_user: "{{ pg_user }}"
become: yes
postgresql_owner:
Expand Down
Expand Up @@ -499,7 +499,7 @@
# Test ALL_IN_SCHEMA for 'partioned tables type #
#################################################

# Partioning tables is a feature introduced in Postgresql 10.
# Partitioning tables is a feature introduced in Postgresql 10.
# (see https://www.postgresql.org/docs/10/ddl-partitioning.html )
# The test below check for this version

Expand Down
50 changes: 25 additions & 25 deletions test/integration/targets/postgresql/tasks/postgresql_sequence.yml
Expand Up @@ -45,7 +45,7 @@

####################
# Test: create sequence in checkmode
- name: postgresql_sequence - create a new seqeunce with name "foobar" in check_mode
- name: postgresql_sequence - create a new sequence with name "foobar" in check_mode
become_user: "{{ pg_user }}"
become: yes
check_mode: yes
Expand All @@ -64,7 +64,7 @@
- result.queries == ["CREATE SEQUENCE \"public\".\"foobar\""]

# Real SQL check
- name: postgresql_sequence - check that the new seqeunce "foobar" not exists
- name: postgresql_sequence - check that the new sequence "foobar" not exists
become: yes
become_user: "{{ pg_user }}"
postgresql_query:
Expand All @@ -81,7 +81,7 @@

####################
# Test: create sequence
- name: postgresql_sequence - create a new seqeunce with name "foobar"
- name: postgresql_sequence - create a new sequence with name "foobar"
become_user: "{{ pg_user }}"
become: yes
postgresql_sequence:
Expand All @@ -99,7 +99,7 @@
- result.queries == ["CREATE SEQUENCE \"public\".\"foobar\""]

# Real SQL check
- name: postgresql_sequence - check that the new seqeunce "foobar" exists
- name: postgresql_sequence - check that the new sequence "foobar" exists
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand Down Expand Up @@ -135,7 +135,7 @@
- result.queries == ["DROP SEQUENCE \"public\".\"foobar\""]

# Real SQL check
- name: postgresql_sequence - check that the seqeunce "foobar" still exists
- name: postgresql_sequence - check that the sequence "foobar" still exists
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand Down Expand Up @@ -170,7 +170,7 @@
- result.queries == ["DROP SEQUENCE \"public\".\"foobar\""]

# Real SQL check
- name: postgresql_sequence - check that the seqeunce "foobar" not exists
- name: postgresql_sequence - check that the sequence "foobar" not exists
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand Down Expand Up @@ -205,7 +205,7 @@
- result.queries == []

# Real SQL check
- name: postgresql_sequence - check that the seqeunce "foobar" not exists
- name: postgresql_sequence - check that the sequence "foobar" not exists
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand Down Expand Up @@ -248,7 +248,7 @@
- result.queries == ["CREATE SEQUENCE \"public\".\"foobar_desc\" INCREMENT BY -1 MINVALUE 1 MAXVALUE 1000 START WITH 101 CYCLE"]

# Real SQL check
- name: postgresql_sequence - check that the new seqeunce "foobar_desc" exists
- name: postgresql_sequence - check that the new sequence "foobar_desc" exists
postgresql_query:
db: "{{ db_name }}"
login_user: "{{ pg_user }}"
Expand Down Expand Up @@ -283,7 +283,7 @@
- result.queries == ["ALTER SEQUENCE \"public\".\"foobar_desc\" RENAME TO \"foobar_with_options\""]

# Real SQL check
- name: postgresql_sequence - check that the seqeunce "foobar_desc" still exists and is not renamed
- name: postgresql_sequence - check that the sequence "foobar_desc" still exists and is not renamed
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand Down Expand Up @@ -319,7 +319,7 @@
- result.queries == ["ALTER SEQUENCE \"public\".\"foobar_desc\" RENAME TO \"foobar_with_options\""]

# Real SQL check
- name: postgresql_sequence - check that the renamed seqeunce "foobar_with_options" exists
- name: postgresql_sequence - check that the renamed sequence "foobar_with_options" exists
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand Down Expand Up @@ -357,7 +357,7 @@
- result.queries == ["ALTER SEQUENCE \"public\".\"foobar_with_options\" SET SCHEMA \"foobar_schema\""]

# Real SQL check
- name: postgresql_sequence - check that the seqeunce "foobar_with_options" still exists in the old schema
- name: postgresql_sequence - check that the sequence "foobar_with_options" still exists in the old schema
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand Down Expand Up @@ -394,7 +394,7 @@
- result.queries == ["ALTER SEQUENCE \"public\".\"foobar_with_options\" SET SCHEMA \"foobar_schema\""]

# Real SQL check
- name: postgresql_sequence - check that the seqeunce "foobar_with_options" exists in new schema
- name: postgresql_sequence - check that the sequence "foobar_with_options" exists in new schema
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand Down Expand Up @@ -432,7 +432,7 @@
- result.queries == ["ALTER SEQUENCE \"foobar_schema\".\"foobar_with_options\" OWNER TO \"{{ db_user1 }}\""]

# Real SQL check
- name: postgresql_sequence - check that the seqeunce "foobar_with_options" has still the old owner
- name: postgresql_sequence - check that the sequence "foobar_with_options" has still the old owner
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand Down Expand Up @@ -476,7 +476,7 @@
- result.queries == ["ALTER SEQUENCE \"foobar_schema\".\"foobar_with_options\" OWNER TO \"{{ db_user1 }}\""]

# Real SQL check
- name: postgresql_sequence - check that the seqeunce "foobar_with_options" has a new owner
- name: postgresql_sequence - check that the sequence "foobar_with_options" has a new owner
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand All @@ -498,7 +498,7 @@
- result.rowcount == 1

####################
# Test: drop seqeunce with cascade
# Test: drop sequence with cascade

# CREATE SEQUENCE seq1;
# CREATE TABLE t1 (f1 INT NOT NULL DEFAULT nextval('seq1'));
Expand All @@ -511,7 +511,7 @@
login_user: "{{ pg_user }}"
name: seq1

- name: postgresql_sequence - create table which use seqeunce for drop cascade test
- name: postgresql_sequence - create table which use sequence for drop cascade test
become_user: "{{ pg_user }}"
become: yes
postgresql_table:
Expand All @@ -522,7 +522,7 @@
- f1 INT NOT NULL DEFAULT nextval('seq1')

####################
# Test: drop seqeunce with cascade in checkmode
# Test: drop sequence with cascade in checkmode
- name: postgresql_sequence - drop with cascade a sequence called seq1
become_user: "{{ pg_user }}"
become: yes
Expand All @@ -544,7 +544,7 @@
- result.queries == ["DROP SEQUENCE \"public\".\"seq1\" CASCADE"]

# Real SQL check
- name: postgresql_sequence - check that the seqeunce "seq1" still exists
- name: postgresql_sequence - check that the sequence "seq1" still exists
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand All @@ -559,7 +559,7 @@
- result.rowcount == 1

####################
# Test: drop seqeunce with cascade
# Test: drop sequence with cascade
- name: postgresql_sequence - drop with cascade a sequence called seq1
become_user: "{{ pg_user }}"
become: yes
Expand All @@ -580,7 +580,7 @@
- result.queries == ["DROP SEQUENCE \"public\".\"seq1\" CASCADE"]

# Real SQL check
- name: postgresql_sequence - check that the seqeunce "seq1" not exists
- name: postgresql_sequence - check that the sequence "seq1" not exists
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand All @@ -596,7 +596,7 @@

####################
# Test: create sequence with owner in checkmode
- name: postgresql_sequence - create a new seqeunce with name "foobar2" with owner "{{ db_user2 }}"
- name: postgresql_sequence - create a new sequence with name "foobar2" with owner "{{ db_user2 }}"
become_user: "{{ pg_user }}"
become: yes
check_mode: yes
Expand All @@ -616,7 +616,7 @@
- result.queries == ["CREATE SEQUENCE \"public\".\"foobar2\"", "ALTER SEQUENCE \"public\".\"foobar2\" OWNER TO \"ansible_db_user2\""]

# Real SQL check
- name: postgresql_sequence - check that the new seqeunce "foobar2" does not exists
- name: postgresql_sequence - check that the new sequence "foobar2" does not exists
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand All @@ -632,7 +632,7 @@

####################
# Test: create sequence with owner
- name: postgresql_sequence - create a new seqeunce with name "foobar2" with owner "{{ db_user2 }}"
- name: postgresql_sequence - create a new sequence with name "foobar2" with owner "{{ db_user2 }}"
become_user: "{{ pg_user }}"
become: yes
postgresql_sequence:
Expand All @@ -651,7 +651,7 @@
- result.queries == ["CREATE SEQUENCE \"public\".\"foobar2\"", "ALTER SEQUENCE \"public\".\"foobar2\" OWNER TO \"ansible_db_user2\""]

# Real SQL check
- name: postgresql_sequence - check that the new seqeunce "foobar2" exists
- name: postgresql_sequence - check that the new sequence "foobar2" exists
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand All @@ -665,7 +665,7 @@
that:
- result.rowcount == 1

- name: postgresql_sequence - check that the seqeunce "foobar2" has owner "{{ db_user2 }}"
- name: postgresql_sequence - check that the sequence "foobar2" has owner "{{ db_user2 }}"
become_user: "{{ pg_user }}"
become: yes
postgresql_query:
Expand Down
6 changes: 3 additions & 3 deletions test/integration/targets/postgresql/tasks/unsorted.yml
Expand Up @@ -73,7 +73,7 @@
login_user: "{{ pg_user }}"
register: result

- name: assert that removing an alreaady removed db makes no change
- name: assert that removing an already removed db makes no change
assert:
that:
- result is not changed
Expand Down Expand Up @@ -132,7 +132,7 @@
- "'en_US' not in result.stdout_lines[-2]"
- "'100' in result.stdout_lines[-2]"

- name: Check that running db cration with options a second time does nothing
- name: Check that running db creation with options a second time does nothing
become_user: "{{ pg_user }}"
become: yes
postgresql_db:
Expand Down Expand Up @@ -237,7 +237,7 @@
loop_var: loop_item

# BYPASSRLS role attribute was introduced in PostgreSQL 9.5, so
# we want to test atrribute management differently depending
# we want to test attribute management differently depending
# on the version.
- set_fact:
bypassrls_supported: "{{ postgres_version_resp.stdout is version('9.5.0', '>=') }}"
Expand Down

0 comments on commit 80c39bd

Please sign in to comment.