Skip to content

Commit

Permalink
Switched arguments names from CamelCase to snake_case (pulumi#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
jancespivo committed Jul 20, 2021
1 parent 6df4847 commit 2fd3b40
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions aws-py-dynamicresource/mysql_dynamic_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ def delete(self, id, args):

# The function that determines if an existing resource whose inputs were
# modified needs to be updated or entirely replaced
def diff(self, id, oldInputs, newInputs):
def diff(self, id, old_inputs, new_inputs):
# server_address, database_name, and creation_script are critical inputs
# that require the resource to be entirely replaced if they are modified.
# Changes in other inputs mean the resource can be safely updated without
# recreating it
replaces = []
if (oldInputs["server_address"] != newInputs["server_address"]): replaces.append("server_address")
if (oldInputs["database_name"] != newInputs["database_name"]): replaces.append("database_name")
if (oldInputs["creation_script"] != newInputs["creation_script"]): replaces.append("creation_script")
if (old_inputs["server_address"] != new_inputs["server_address"]): replaces.append("server_address")
if (old_inputs["database_name"] != new_inputs["database_name"]): replaces.append("database_name")
if (old_inputs["creation_script"] != new_inputs["creation_script"]): replaces.append("creation_script")

return DiffResult(
# If the old and new inputs don't match, the resource needs to be updated/replaced
changes=oldInputs != newInputs,
changes=old_inputs != new_inputs,
# If the replaces[] list is empty, nothing important was changed, and we do not have to
# replace the resource
replaces=replaces,
Expand All @@ -79,9 +79,9 @@ def diff(self, id, oldInputs, newInputs):

# The function that updates an existing resource without deleting and
# recreating it from scratch
def update(self, id, oldInputs, newInputs):
def update(self, id, old_inputs, new_inputs):
# The old existing inputs are discarded and the new inputs are used
return UpdateResult(outs={**newInputs})
return UpdateResult(outs={**new_inputs})

# The main Schema resource that we instantiate in our infrastructure code
class Schema(Resource):
Expand Down

0 comments on commit 2fd3b40

Please sign in to comment.