project
stringlengths
1
98
commit_sha
stringlengths
40
40
parent_sha
stringlengths
40
40
file_path
stringlengths
4
209
project_url
stringlengths
23
132
likely_bug
bool
1 class
comodified
bool
1 class
in_function
bool
2 classes
diff
stringlengths
27
9.71k
before
stringlengths
1
8.91k
after
stringlengths
1
6k
sstub_pattern
stringclasses
23 values
edit_script
stringlengths
33
158k
key
stringlengths
45
154
commit_message
stringlengths
3
65.5k
files
list
matplotlib
d7a4a8cc10a93646a3cf04bbb093186e64b99264
eb56c3bfef8357c55e218b3a86bfca02feab66fd
lib/matplotlib/axes/_axes.py
https://github.com/dsquareindia/matplotlib
true
false
false
@@ -3139,7 +3139,7 @@ class Axes(_AxesBase): else: final_meanprops = dict(linestyle='none', markerfacecolor='red', marker='s') - if final_meanprops is not None: + if meanprops is not None: final_meanprops.update(meanprops) def to_vc(xs, ys):
if final_meanprops is not None : final_meanprops . update ( meanprops )
if meanprops is not None : final_meanprops . update ( meanprops )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:final_meanprops", 3, 12, 3, 27], "meanprops"]]
dsquareindia/matplotlib@d7a4a8cc10a93646a3cf04bbb093186e64b99264
null
null
matplotlib
9b0118f003a101e7ca2928763d4ada06264230d6
f2aea5b114e70a499c51d3d6aa3b2ac1190749c8
lib/matplotlib/axes/_axes.py
https://github.com/dsquareindia/matplotlib
true
false
false
@@ -2945,7 +2945,7 @@ class Axes(_AxesBase): # replace medians if necessary: if usermedians is not None: - if (len(np.ravel(usermedians)) != len(bxpstats) and + if (len(np.ravel(usermedians)) != len(bxpstats) or np.shape(usermedians)[0] != len(bxpstats)): medmsg = 'usermedians length not compatible with x' raise ValueError(medmsg)
if ( len ( np . ravel ( usermedians ) ) != len ( bxpstats ) and np . shape ( usermedians ) [ 0 ] != len ( bxpstats ) ) : medmsg = 'usermedians length not compatible with x' raise ValueError ( medmsg )
if ( len ( np . ravel ( usermedians ) ) != len ( bxpstats ) or np . shape ( usermedians ) [ 0 ] != len ( bxpstats ) ) : medmsg = 'usermedians length not compatible with x' raise ValueError ( medmsg )
CHANGE_BINARY_OPERATOR
[["Insert", ["boolean_operator", 3, 17, 4, 58], ["or:or", "T"], 1], ["Delete", ["and:and", 3, 61, 3, 64]]]
dsquareindia/matplotlib@9b0118f003a101e7ca2928763d4ada06264230d6
null
null
awx
6d6d9de37968e2eea84bafe5fb4f0985f8d359f9
1abb2f7dfd6a658b2a1181e36620063a99d6d1d8
awx/main/management/commands/age_deleted.py
https://github.com/gconsidine/awx
true
false
true
@@ -88,7 +88,7 @@ class Command(BaseCommand): print('unable to find deleted timestamp in %s field' % name_field) else: aged_date = dt - datetime.timedelta(days=self.days) - instance.name = name_prefix + aged_date.isoformat() + name_append + setattr(instance, name_field, name_prefix + aged_date.isoformat() + name_append) instance.save() #print("Aged %s" % instance.name) n_aged_items += 1
instance . name = name_prefix + aged_date . isoformat ( ) + name_append
setattr ( instance , name_field , name_prefix + aged_date . isoformat ( ) + name_append )
SINGLE_STMT
[["Insert", ["expression_statement", 3, 17, 3, 82], ["call", "N0"], 0], ["Insert", "N0", ["identifier:setattr", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["identifier:instance", 3, 17, 3, 25], 1], ["Insert", "N1", [",:,", "T"], 2], ["Update", ["identifier:name", 3, 26, 3, 30], "name_field"], ["Move", "N1", ["identifier:name", 3, 26, 3, 30], 3], ["Insert", "N1", [",:,", "T"], 4], ["Move", "N1", ["binary_operator", 3, 33, 3, 82], 5], ["Insert", "N1", ["):)", "T"], 6], ["Delete", [".:.", 3, 25, 3, 26]], ["Delete", ["attribute", 3, 17, 3, 30]], ["Delete", ["=:=", 3, 31, 3, 32]], ["Delete", ["assignment", 3, 17, 3, 82]]]
gconsidine/awx@6d6d9de37968e2eea84bafe5fb4f0985f8d359f9
Use the proper attr when saving instance name Fixes: https://trello.com/c/24OoIyyf
[ { "sha": "6a6f0ef65151a42e98989fe470a6771dde68fe91", "filename": "awx/main/management/commands/age_deleted.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/6d6d9de37968e2eea84bafe5fb4f0985f8d359f9/awx%2Fmain%2Fmanagement%2Fcommands%2Fage_deleted.py", "raw_url": "https://github.com/gconsidine/awx/raw/6d6d9de37968e2eea84bafe5fb4f0985f8d359f9/awx%2Fmain%2Fmanagement%2Fcommands%2Fage_deleted.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmanagement%2Fcommands%2Fage_deleted.py?ref=6d6d9de37968e2eea84bafe5fb4f0985f8d359f9", "patch": "@@ -88,7 +88,7 @@ def cleanup_model(self, model, id=None):\n print('unable to find deleted timestamp in %s field' % name_field)\n else:\n aged_date = dt - datetime.timedelta(days=self.days)\n- instance.name = name_prefix + aged_date.isoformat() + name_append\n+ setattr(instance, name_field, name_prefix + aged_date.isoformat() + name_append)\n instance.save()\n #print(\"Aged %s\" % instance.name)\n n_aged_items += 1" } ]
awx
237a66191295cce2cd52d78bcdb7cbe57e399e56
40f0548fe7b3d4016b0b2750624612df9602dcdd
awx/main/management/commands/remove_instance.py
https://github.com/gconsidine/awx
true
false
true
@@ -33,7 +33,7 @@ class Command(BaseCommandInstance): # Sanity check: Do not remove the primary instance. if instance.primary: - raise CommandError('I cowardly refuse to remove the primary instance %s.' % instance_str(instance)) + raise CommandError('Can not remove primary instance %s. Another instance must be promoted to primary first.' % instance_str(instance)) # Remove the instance. instance.delete()
raise CommandError ( 'I cowardly refuse to remove the primary instance %s.' % instance_str ( instance ) )
raise CommandError ( 'Can not remove primary instance %s. Another instance must be promoted to primary first.' % instance_str ( instance ) )
CHANGE_BINARY_OPERAND
[["Update", ["string:'I cowardly refuse to remove the primary instance %s.'", 3, 36, 3, 90], "'Can not remove primary instance %s. Another instance must be promoted to primary first.'"]]
gconsidine/awx@237a66191295cce2cd52d78bcdb7cbe57e399e56
Fix verbage around why we are disallowing removing a primary
[ { "sha": "6eb5c35a023270b25fbbfab5eea2ce96eaff431b", "filename": "awx/main/management/commands/remove_instance.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/237a66191295cce2cd52d78bcdb7cbe57e399e56/awx%2Fmain%2Fmanagement%2Fcommands%2Fremove_instance.py", "raw_url": "https://github.com/gconsidine/awx/raw/237a66191295cce2cd52d78bcdb7cbe57e399e56/awx%2Fmain%2Fmanagement%2Fcommands%2Fremove_instance.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmanagement%2Fcommands%2Fremove_instance.py?ref=237a66191295cce2cd52d78bcdb7cbe57e399e56", "patch": "@@ -33,7 +33,7 @@ def handle(self, *args, **options):\n \n # Sanity check: Do not remove the primary instance.\n if instance.primary:\n- raise CommandError('I cowardly refuse to remove the primary instance %s.' % instance_str(instance))\n+ raise CommandError('Can not remove primary instance %s. Another instance must be promoted to primary first.' % instance_str(instance))\n \n # Remove the instance.\n instance.delete()" } ]
awx
5a77d1f0d47244262066b7666653311f4391089b
ef95cf091e2bf7759d5365a0f4655311f327c7e3
awx/main/tasks.py
https://github.com/gconsidine/awx
true
false
true
@@ -140,7 +140,7 @@ def mongodb_control(cmd): if cmd == 'stop': time.sleep(30) - p = subprocess.Popen('sudo mongod --shutdown -c /etc/mongod.conf') + p = subprocess.Popen('sudo mongod --shutdown -f /etc/mongod.conf') out, err = p.communicate() logger.info("Shutdown command output: %s;%s" % (out, err))
p = subprocess . Popen ( 'sudo mongod --shutdown -c /etc/mongod.conf' )
p = subprocess . Popen ( 'sudo mongod --shutdown -f /etc/mongod.conf' )
CHANGE_STRING_LITERAL
[["Update", ["string:'sudo mongod --shutdown -c /etc/mongod.conf'", 3, 30, 3, 74], "'sudo mongod --shutdown -f /etc/mongod.conf'"]]
gconsidine/awx@5a77d1f0d47244262066b7666653311f4391089b
Fix up mongo service handline and task logging * Use -f instead of -c for mongod when refernecing config file for shutdown behavior in the stop task * Fix up task logging to use new supervisor configuration syntax
[ { "sha": "800225e02ffe2de4148814768b79026cd94970c0", "filename": "awx/main/tasks.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/5a77d1f0d47244262066b7666653311f4391089b/awx%2Fmain%2Ftasks.py", "raw_url": "https://github.com/gconsidine/awx/raw/5a77d1f0d47244262066b7666653311f4391089b/awx%2Fmain%2Ftasks.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftasks.py?ref=5a77d1f0d47244262066b7666653311f4391089b", "patch": "@@ -140,7 +140,7 @@ def mongodb_control(cmd):\n \n if cmd == 'stop':\n time.sleep(30)\n- p = subprocess.Popen('sudo mongod --shutdown -c /etc/mongod.conf')\n+ p = subprocess.Popen('sudo mongod --shutdown -f /etc/mongod.conf')\n out, err = p.communicate()\n logger.info(\"Shutdown command output: %s;%s\" % (out, err))\n " } ]
awx
10f5308bd8af801160a6646850a8853ac4abc02e
5a77d1f0d47244262066b7666653311f4391089b
awx/main/utils.py
https://github.com/gconsidine/awx
true
false
true
@@ -99,7 +99,7 @@ def get_ansible_version(): proc = subprocess.Popen(['ansible', '--version'], stdout=subprocess.PIPE) result = proc.communicate()[0] - stripped_result = result.lower().replace('ansible', '').strip().split(" ")[0] + stripped_result = result.split('\n')[0].replace('ansible', '').strip() return stripped_result except: return 'unknown'
stripped_result = result . lower ( ) . replace ( 'ansible' , '' ) . strip ( ) . split ( " " ) [ 0 ]
stripped_result = result . split ( '\n' ) [ 0 ] . replace ( 'ansible' , '' ) . strip ( )
SINGLE_STMT
[["Move", ["assignment", 3, 9, 3, 86], ["call", 3, 27, 3, 72], 2], ["Insert", ["attribute", 3, 27, 3, 49], ["subscript", "N0"], 0], ["Move", "N0", ["call", 3, 27, 3, 41], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["integer:0", "T"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Update", ["identifier:lower", 3, 34, 3, 39], "split"], ["Insert", ["argument_list", 3, 39, 3, 41], ["string:'\\n'", "T"], 1], ["Delete", [".:.", 3, 72, 3, 73]], ["Delete", ["identifier:split", 3, 73, 3, 78]], ["Delete", ["attribute", 3, 27, 3, 78]], ["Delete", ["(:(", 3, 78, 3, 79]], ["Delete", ["string:\" \"", 3, 79, 3, 82]], ["Delete", ["):)", 3, 82, 3, 83]], ["Delete", ["argument_list", 3, 78, 3, 83]], ["Delete", ["call", 3, 27, 3, 83]], ["Delete", ["[:[", 3, 83, 3, 84]], ["Delete", ["integer:0", 3, 84, 3, 85]], ["Delete", ["]:]", 3, 85, 3, 86]], ["Delete", ["subscript", 3, 27, 3, 86]]]
gconsidine/awx@10f5308bd8af801160a6646850a8853ac4abc02e
Fix version parsing of ansible to exclude newlines
[ { "sha": "1d07e5f4f77e0108fe6fd94eae47fe1284d348f5", "filename": "awx/main/utils.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/10f5308bd8af801160a6646850a8853ac4abc02e/awx%2Fmain%2Futils.py", "raw_url": "https://github.com/gconsidine/awx/raw/10f5308bd8af801160a6646850a8853ac4abc02e/awx%2Fmain%2Futils.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Futils.py?ref=10f5308bd8af801160a6646850a8853ac4abc02e", "patch": "@@ -99,7 +99,7 @@ def get_ansible_version():\n proc = subprocess.Popen(['ansible', '--version'],\n stdout=subprocess.PIPE)\n result = proc.communicate()[0]\n- stripped_result = result.lower().replace('ansible', '').strip().split(\" \")[0]\n+ stripped_result = result.split('\\n')[0].replace('ansible', '').strip()\n return stripped_result\n except:\n return 'unknown'" } ]
awx
7e45ee8b557087af1da3478c58d85638920b271a
3a61896cb53e04ac944d8b423bfa765ad0a75022
awx/main/models/unified_jobs.py
https://github.com/gconsidine/awx
true
false
true
@@ -598,7 +598,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique if self.result_stdout_text: return StringIO(self.result_stdout_text) else: - if not os.path.exists(self.result_stdout_file): + if not os.path.exists(self.result_stdout_file) or os.stat(self.result_stdout_file).st_size < 1: return StringIO(msg['missing' if self.finished else 'pending']) # There is a potential timing issue here, because another
if not os . path . exists ( self . result_stdout_file ) : return StringIO ( msg [ 'missing' if self . finished else 'pending' ] )
if not os . path . exists ( self . result_stdout_file ) or os . stat ( self . result_stdout_file ) . st_size < 1 : return StringIO ( msg [ 'missing' if self . finished else 'pending' ] )
LESS_SPECIFIC_IF
[["Insert", ["not_operator", 3, 16, 3, 59], ["boolean_operator", "N0"], 1], ["Move", "N0", ["call", 3, 20, 3, 59], 0], ["Insert", "N0", ["or:or", "T"], 1], ["Insert", "N0", ["comparison_operator", "N1"], 2], ["Insert", "N1", ["attribute", "N2"], 0], ["Insert", "N1", ["<:<", "T"], 1], ["Insert", "N1", ["integer:1", "T"], 2], ["Insert", "N2", ["call", "N3"], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:st_size", "T"], 2], ["Insert", "N3", ["attribute", "N4"], 0], ["Insert", "N3", ["argument_list", "N5"], 1], ["Insert", "N4", ["identifier:os", "T"], 0], ["Insert", "N4", [".:.", "T"], 1], ["Insert", "N4", ["identifier:stat", "T"], 2], ["Insert", "N5", ["(:(", "T"], 0], ["Insert", "N5", ["attribute", "N6"], 1], ["Insert", "N5", ["):)", "T"], 2], ["Insert", "N6", ["identifier:self", "T"], 0], ["Insert", "N6", [".:.", "T"], 1], ["Insert", "N6", ["identifier:result_stdout_file", "T"], 2]]
gconsidine/awx@7e45ee8b557087af1da3478c58d85638920b271a
Fix empty standard out behavior Previously we could just check for the absence of the stdout file to know we didn't yet/wouldn't ever have any stdout content. Now that we are creating the stdout file ahead of time and persisting it we need to also check to see if the file contains any data. This is also necessary for some unit tests.
[ { "sha": "00deb50691bd738d5c58a7676241274b7887b6fe", "filename": "awx/main/models/unified_jobs.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/7e45ee8b557087af1da3478c58d85638920b271a/awx%2Fmain%2Fmodels%2Funified_jobs.py", "raw_url": "https://github.com/gconsidine/awx/raw/7e45ee8b557087af1da3478c58d85638920b271a/awx%2Fmain%2Fmodels%2Funified_jobs.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Funified_jobs.py?ref=7e45ee8b557087af1da3478c58d85638920b271a", "patch": "@@ -598,7 +598,7 @@ def result_stdout_raw_handle(self, attempt=0):\n if self.result_stdout_text:\n return StringIO(self.result_stdout_text)\n else:\n- if not os.path.exists(self.result_stdout_file):\n+ if not os.path.exists(self.result_stdout_file) or os.stat(self.result_stdout_file).st_size < 1:\n return StringIO(msg['missing' if self.finished else 'pending'])\n \n # There is a potential timing issue here, because another" } ]
awx
b1c12ca120c3bdca8b1db53dc65b5caf8205e54f
dc0d732ad4a3a6cc6a58441b4370cedf19d2aca1
awx/main/models/unified_jobs.py
https://github.com/gconsidine/awx
true
false
true
@@ -598,7 +598,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique if self.result_stdout_text: return StringIO(self.result_stdout_text) else: - if not os.path.exists(self.result_stdout_file): + if not os.path.exists(self.result_stdout_file) or os.stat(self.result_stdout_file).st_size < 1: return StringIO(msg['missing' if self.finished else 'pending']) # There is a potential timing issue here, because another
if not os . path . exists ( self . result_stdout_file ) : return StringIO ( msg [ 'missing' if self . finished else 'pending' ] )
if not os . path . exists ( self . result_stdout_file ) or os . stat ( self . result_stdout_file ) . st_size < 1 : return StringIO ( msg [ 'missing' if self . finished else 'pending' ] )
LESS_SPECIFIC_IF
[["Insert", ["not_operator", 3, 16, 3, 59], ["boolean_operator", "N0"], 1], ["Move", "N0", ["call", 3, 20, 3, 59], 0], ["Insert", "N0", ["or:or", "T"], 1], ["Insert", "N0", ["comparison_operator", "N1"], 2], ["Insert", "N1", ["attribute", "N2"], 0], ["Insert", "N1", ["<:<", "T"], 1], ["Insert", "N1", ["integer:1", "T"], 2], ["Insert", "N2", ["call", "N3"], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:st_size", "T"], 2], ["Insert", "N3", ["attribute", "N4"], 0], ["Insert", "N3", ["argument_list", "N5"], 1], ["Insert", "N4", ["identifier:os", "T"], 0], ["Insert", "N4", [".:.", "T"], 1], ["Insert", "N4", ["identifier:stat", "T"], 2], ["Insert", "N5", ["(:(", "T"], 0], ["Insert", "N5", ["attribute", "N6"], 1], ["Insert", "N5", ["):)", "T"], 2], ["Insert", "N6", ["identifier:self", "T"], 0], ["Insert", "N6", [".:.", "T"], 1], ["Insert", "N6", ["identifier:result_stdout_file", "T"], 2]]
gconsidine/awx@b1c12ca120c3bdca8b1db53dc65b5caf8205e54f
Fix empty standard out behavior Previously we could just check for the absence of the stdout file to know we didn't yet/wouldn't ever have any stdout content. Now that we are creating the stdout file ahead of time and persisting it we need to also check to see if the file contains any data. This is also necessary for some unit tests.
[ { "sha": "00deb50691bd738d5c58a7676241274b7887b6fe", "filename": "awx/main/models/unified_jobs.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/b1c12ca120c3bdca8b1db53dc65b5caf8205e54f/awx%2Fmain%2Fmodels%2Funified_jobs.py", "raw_url": "https://github.com/gconsidine/awx/raw/b1c12ca120c3bdca8b1db53dc65b5caf8205e54f/awx%2Fmain%2Fmodels%2Funified_jobs.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Funified_jobs.py?ref=b1c12ca120c3bdca8b1db53dc65b5caf8205e54f", "patch": "@@ -598,7 +598,7 @@ def result_stdout_raw_handle(self, attempt=0):\n if self.result_stdout_text:\n return StringIO(self.result_stdout_text)\n else:\n- if not os.path.exists(self.result_stdout_file):\n+ if not os.path.exists(self.result_stdout_file) or os.stat(self.result_stdout_file).st_size < 1:\n return StringIO(msg['missing' if self.finished else 'pending'])\n \n # There is a potential timing issue here, because another" } ]
awx
453bbf64e919c01056959078aeece94b8fc8207e
62391cb864febaee4f3d0331c8c68403576e7c20
awx/main/models/inventory.py
https://github.com/gconsidine/awx
true
false
false
@@ -60,7 +60,7 @@ class Inventory(CommonModel): total_hosts = models.PositiveIntegerField( default=0, editable=False, - help_text=_('Total mumber of hosts in this inventory.'), + help_text=_('Total number of hosts in this inventory.'), ) hosts_with_active_failures = models.PositiveIntegerField( default=0,
total_hosts = models . PositiveIntegerField ( default = 0 , editable = False , help_text = _ ( 'Total mumber of hosts in this inventory.' ) , )
total_hosts = models . PositiveIntegerField ( default = 0 , editable = False , help_text = _ ( 'Total number of hosts in this inventory.' ) , )
CHANGE_STRING_LITERAL
[["Update", ["string:'Total mumber of hosts in this inventory.'", 3, 21, 3, 63], "'Total number of hosts in this inventory.'"]]
gconsidine/awx@453bbf64e919c01056959078aeece94b8fc8207e
fixed a typo, mumber to number https://github.com/ansible/ansible-tower/blob/devel/awx/main/models/inventory.py#L63 typo fix from mumber to number
[ { "sha": "d86a500528e68b74c8cbca8fa4aa1899aa58fabc", "filename": "awx/main/models/inventory.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/453bbf64e919c01056959078aeece94b8fc8207e/awx%2Fmain%2Fmodels%2Finventory.py", "raw_url": "https://github.com/gconsidine/awx/raw/453bbf64e919c01056959078aeece94b8fc8207e/awx%2Fmain%2Fmodels%2Finventory.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Finventory.py?ref=453bbf64e919c01056959078aeece94b8fc8207e", "patch": "@@ -60,7 +60,7 @@ class Meta:\n total_hosts = models.PositiveIntegerField(\n default=0,\n editable=False,\n- help_text=_('Total mumber of hosts in this inventory.'),\n+ help_text=_('Total number of hosts in this inventory.'),\n )\n hosts_with_active_failures = models.PositiveIntegerField(\n default=0," } ]
awx
15005d3e6be0756d559ebfb93f7fc83ef7edad27
55e7458ebfb2fbceed7ff10d562e21352543dd33
awx/main/models/inventory.py
https://github.com/gconsidine/awx
true
false
true
@@ -1259,7 +1259,7 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions): if not super(InventoryUpdate, self).can_start: return False - if (self.source != 'custom' and + if (self.source not in ('custom', 'ec2') and not (self.credential and self.credential.active)): return False return True
if ( self . source != 'custom' and not ( self . credential and self . credential . active ) ) : return False
if ( self . source not in ( 'custom' , 'ec2' ) and not ( self . credential and self . credential . active ) ) : return False
CHANGE_BINARY_OPERAND
[["Insert", ["comparison_operator", 3, 13, 3, 36], ["not:not", "T"], 1], ["Insert", ["comparison_operator", 3, 13, 3, 36], ["in:in", "T"], 2], ["Insert", ["comparison_operator", 3, 13, 3, 36], ["tuple", "N0"], 3], ["Insert", "N0", ["(:(", "T"], 0], ["Move", "N0", ["string:'custom'", 3, 28, 3, 36], 1], ["Insert", "N0", [",:,", "T"], 2], ["Insert", "N0", ["string:'ec2'", "T"], 3], ["Insert", "N0", ["):)", "T"], 4], ["Delete", ["!=:!=", 3, 25, 3, 27]]]
gconsidine/awx@15005d3e6be0756d559ebfb93f7fc83ef7edad27
Fix issue with ec2 iam sync with no credential. When checking if an inventory sync can start allow an ec2 sync to run even if credentials are not supplied
[ { "sha": "51efab2690cb9bf2c501bbfb8c3515afa056745d", "filename": "awx/main/models/inventory.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/15005d3e6be0756d559ebfb93f7fc83ef7edad27/awx%2Fmain%2Fmodels%2Finventory.py", "raw_url": "https://github.com/gconsidine/awx/raw/15005d3e6be0756d559ebfb93f7fc83ef7edad27/awx%2Fmain%2Fmodels%2Finventory.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Finventory.py?ref=15005d3e6be0756d559ebfb93f7fc83ef7edad27", "patch": "@@ -1259,7 +1259,7 @@ def can_start(self):\n if not super(InventoryUpdate, self).can_start:\n return False\n \n- if (self.source != 'custom' and\n+ if (self.source not in ('custom', 'ec2') and\n not (self.credential and self.credential.active)):\n return False\n return True" } ]
neo-python
de0cbf02f8ac33c4a1c9f5fd585e387f8737e79a
a3e5d25d0b52b2a5a62665290c9122cc2666a974
sdk/AntShares/Core/Scripts/ScriptBuilder.py
https://github.com/Ranchosm335/neo-python
true
false
true
@@ -27,7 +27,7 @@ class ScriptBuilder(object): def push(self, data): if data == None: return - if type(data) == 'int': + if isinstance(data,int): if data == -1: return self.add(ScriptOp.OP_1NEGATE) elif data == 0:
if type ( data ) == 'int' : if data == - 1 : return self . add ( ScriptOp . OP_1NEGATE ) elif data == 0 :
if isinstance ( data , int ) : if data == - 1 : return self . add ( ScriptOp . OP_1NEGATE ) elif data == 0 :
SINGLE_STMT
[["Move", ["if_statement", 3, 9, 6, 28], ["call", 3, 12, 3, 22], 1], ["Update", ["identifier:type", 3, 12, 3, 16], "isinstance"], ["Insert", ["argument_list", 3, 16, 3, 22], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 16, 3, 22], ["identifier:int", "T"], 3], ["Delete", ["==:==", 3, 23, 3, 25]], ["Delete", ["string:'int'", 3, 26, 3, 31]], ["Delete", ["comparison_operator", 3, 12, 3, 31]]]
Ranchosm335/neo-python@de0cbf02f8ac33c4a1c9f5fd585e387f8737e79a
Fixed: AntShares.Core.Scripts.ScriptBuilder.push(data) data can't be int type
[ { "sha": "7f43bb8d7f903910e436d06130755c0907e13e6c", "filename": "sdk/AntShares/Core/Scripts/ScriptBuilder.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Ranchosm335/neo-python/blob/de0cbf02f8ac33c4a1c9f5fd585e387f8737e79a/sdk%2FAntShares%2FCore%2FScripts%2FScriptBuilder.py", "raw_url": "https://github.com/Ranchosm335/neo-python/raw/de0cbf02f8ac33c4a1c9f5fd585e387f8737e79a/sdk%2FAntShares%2FCore%2FScripts%2FScriptBuilder.py", "contents_url": "https://api.github.com/repos/Ranchosm335/neo-python/contents/sdk%2FAntShares%2FCore%2FScripts%2FScriptBuilder.py?ref=de0cbf02f8ac33c4a1c9f5fd585e387f8737e79a", "patch": "@@ -27,7 +27,7 @@ def add(self, op):\n def push(self, data):\n if data == None:\n return\n- if type(data) == 'int':\n+ if isinstance(data,int):\n if data == -1:\n return self.add(ScriptOp.OP_1NEGATE)\n elif data == 0:" } ]
awx
92117ae460200630983e4b4bbb9d9aaa7ba9afe8
dc661e6ba58b3a053d0b0eaa1b172a20abd4cb87
awx/main/management/commands/run_socketio_service.py
https://github.com/gconsidine/awx
true
false
true
@@ -76,7 +76,7 @@ def notification_handler(bind_port, server): while True: message = handler_socket.recv_json() packet = dict(type='event', name=message['event'], endpoint=message['endpoint'], args=message) - for session_id, socket in server.sockets.iteritems(): + for session_id, socket in list(server.sockets.iteritems()): socket.send_packet(packet) class Command(NoArgsCommand):
for session_id , socket in server . sockets . iteritems ( ) : socket . send_packet ( packet )
for session_id , socket in list ( server . sockets . iteritems ( ) ) : socket . send_packet ( packet )
ADD_FUNCTION_AROUND_EXPRESSION
[["Insert", ["call", 3, 35, 3, 61], ["identifier:list", "T"], 0], ["Insert", ["call", 3, 35, 3, 61], ["argument_list", "N0"], 1], ["Insert", "N0", ["(:(", "T"], 0], ["Move", "N0", ["call", 3, 35, 3, 61], 1], ["Insert", "N0", ["):)", "T"], 2]]
gconsidine/awx@92117ae460200630983e4b4bbb9d9aaa7ba9afe8
Copy socket list in place to prevent a runtimeerror when the socket list gets updated in the middle of notifications Fixes https://trello.com/c/Q0bwCU9R/61-traceback-from-run-socketio-service
[ { "sha": "50602dc30918c75fbb2ce2a87de370db23ab094d", "filename": "awx/main/management/commands/run_socketio_service.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/92117ae460200630983e4b4bbb9d9aaa7ba9afe8/awx%2Fmain%2Fmanagement%2Fcommands%2Frun_socketio_service.py", "raw_url": "https://github.com/gconsidine/awx/raw/92117ae460200630983e4b4bbb9d9aaa7ba9afe8/awx%2Fmain%2Fmanagement%2Fcommands%2Frun_socketio_service.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmanagement%2Fcommands%2Frun_socketio_service.py?ref=92117ae460200630983e4b4bbb9d9aaa7ba9afe8", "patch": "@@ -76,7 +76,7 @@ def notification_handler(bind_port, server):\n while True:\n message = handler_socket.recv_json()\n packet = dict(type='event', name=message['event'], endpoint=message['endpoint'], args=message)\n- for session_id, socket in server.sockets.iteritems():\n+ for session_id, socket in list(server.sockets.iteritems()):\n socket.send_packet(packet)\n \n class Command(NoArgsCommand):" } ]
awx
3cd5c40dd55b05d3f603a1e0dc74eb85d2175a74
6e9becb4b8cd0c0c41b4ea341bf0710b3e892025
awx/settings/defaults.py
https://github.com/gconsidine/awx
true
false
false
@@ -395,7 +395,7 @@ else: CALLBACK_CONSUMER_PORT = "tcp://127.0.0.1:5556" CALLBACK_QUEUE_PORT = "ipc:///tmp/callback_receiver.ipc" -TASK_COMMAND_PORT = "tcp://127.0.0.1:6556" +TASK_COMMAND_PORT = "tcp://127.0.0.1:6559" SOCKETIO_NOTIFICATION_PORT = "tcp://127.0.0.1:6557" SOCKETIO_LISTEN_PORT = 8080
TASK_COMMAND_PORT = "tcp://127.0.0.1:6556"
TASK_COMMAND_PORT = "tcp://127.0.0.1:6559"
CHANGE_STRING_LITERAL
[["Update", ["string:\"tcp://127.0.0.1:6556\"", 3, 21, 3, 43], "\"tcp://127.0.0.1:6559\""]]
gconsidine/awx@3cd5c40dd55b05d3f603a1e0dc74eb85d2175a74
Move default task management system port to 6559 from 6556 to keep from conflicting with Nagios plugins
[ { "sha": "64935b91df8046a6738d6ee979bb867d7f6366c3", "filename": "awx/settings/defaults.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/3cd5c40dd55b05d3f603a1e0dc74eb85d2175a74/awx%2Fsettings%2Fdefaults.py", "raw_url": "https://github.com/gconsidine/awx/raw/3cd5c40dd55b05d3f603a1e0dc74eb85d2175a74/awx%2Fsettings%2Fdefaults.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fsettings%2Fdefaults.py?ref=3cd5c40dd55b05d3f603a1e0dc74eb85d2175a74", "patch": "@@ -395,7 +395,7 @@\n CALLBACK_CONSUMER_PORT = \"tcp://127.0.0.1:5556\"\n CALLBACK_QUEUE_PORT = \"ipc:///tmp/callback_receiver.ipc\"\n \n-TASK_COMMAND_PORT = \"tcp://127.0.0.1:6556\"\n+TASK_COMMAND_PORT = \"tcp://127.0.0.1:6559\"\n \n SOCKETIO_NOTIFICATION_PORT = \"tcp://127.0.0.1:6557\"\n SOCKETIO_LISTEN_PORT = 8080" } ]
awx
ba44491bf08219d37e2d7a4da736bd26959fd579
364e185412eebbbd80a6861fcdf70640222018d0
awx/api/tests/decorator_paginated.py
https://github.com/gconsidine/awx
true
false
true
@@ -25,7 +25,7 @@ class PaginatedDecoratorTests(TestCase): permission_classes = (AllowAny,) @paginated def get(self, request, limit, ordering, offset): - return ['a', 'b', 'c', 'd', 'e'], 26 + return ['a', 'b', 'c', 'd', 'e'], 26, None self.view = View.as_view() def test_implicit_first_page(self):
return [ 'a' , 'b' , 'c' , 'd' , 'e' ] , 26
return [ 'a' , 'b' , 'c' , 'd' , 'e' ] , 26 , None
SINGLE_STMT
[["Insert", ["expression_list", 3, 24, 3, 53], [",:,", "T"], 3], ["Insert", ["expression_list", 3, 24, 3, 53], ["none:None", "T"], 4]]
gconsidine/awx@ba44491bf08219d37e2d7a4da736bd26959fd579
Fix up pagination tests by updating return assumptions from decorated function
[ { "sha": "0e63327fa0d4ab35c1d5957bc1fad4b3d95de9a0", "filename": "awx/api/tests/decorator_paginated.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/ba44491bf08219d37e2d7a4da736bd26959fd579/awx%2Fapi%2Ftests%2Fdecorator_paginated.py", "raw_url": "https://github.com/gconsidine/awx/raw/ba44491bf08219d37e2d7a4da736bd26959fd579/awx%2Fapi%2Ftests%2Fdecorator_paginated.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Ftests%2Fdecorator_paginated.py?ref=ba44491bf08219d37e2d7a4da736bd26959fd579", "patch": "@@ -25,7 +25,7 @@ class View(APIView):\n permission_classes = (AllowAny,)\n @paginated\n def get(self, request, limit, ordering, offset):\n- return ['a', 'b', 'c', 'd', 'e'], 26\n+ return ['a', 'b', 'c', 'd', 'e'], 26, None\n self.view = View.as_view()\n \n def test_implicit_first_page(self):" } ]
awx
6d2d0aa1a588cac8573755a2fe1109089d35f3f4
8940003a88a9a3908783938b53f4cfdbe2dab6a3
awx/main/access.py
https://github.com/gconsidine/awx
true
false
true
@@ -1086,7 +1086,7 @@ class UnifiedJobTemplateAccess(BaseAccess): def get_queryset(self): qs = self.model.objects.filter(active=True).distinct() - project_qs = self.user.get_queryset(Project).filter(scm_type__in=('',)) + project_qs = self.user.get_queryset(Project).filter(scm_type__in=[s[0] for s in Project.SCM_TYPE_CHOICES]) inventory_source_qs = self.user.get_queryset(InventorySource).filter(source__in=CLOUD_INVENTORY_SOURCES) job_template_qs = self.user.get_queryset(JobTemplate) qs = qs.filter(Q(Project___in=project_qs) |
project_qs = self . user . get_queryset ( Project ) . filter ( scm_type__in = ( '' , ) )
project_qs = self . user . get_queryset ( Project ) . filter ( scm_type__in = [ s [ 0 ] for s in Project . SCM_TYPE_CHOICES ] )
SINGLE_STMT
[["Insert", ["keyword_argument", 3, 61, 3, 79], ["list_comprehension", "N0"], 2], ["Insert", "N0", ["[:[", "T"], 0], ["Insert", "N0", ["subscript", "N1"], 1], ["Insert", "N0", ["for_in_clause", "N2"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Insert", "N1", ["identifier:s", "T"], 0], ["Insert", "N1", ["[:[", "T"], 1], ["Insert", "N1", ["integer:0", "T"], 2], ["Insert", "N1", ["]:]", "T"], 3], ["Insert", "N2", ["for:for", "T"], 0], ["Insert", "N2", ["identifier:s", "T"], 1], ["Insert", "N2", ["in:in", "T"], 2], ["Insert", "N2", ["attribute", "N3"], 3], ["Insert", "N3", ["identifier:Project", "T"], 0], ["Insert", "N3", [".:.", "T"], 1], ["Insert", "N3", ["identifier:SCM_TYPE_CHOICES", "T"], 2], ["Delete", ["(:(", 3, 74, 3, 75]], ["Delete", ["string:''", 3, 75, 3, 77]], ["Delete", [",:,", 3, 77, 3, 78]], ["Delete", ["):)", 3, 78, 3, 79]], ["Delete", ["tuple", 3, 74, 3, 79]]]
gconsidine/awx@6d2d0aa1a588cac8573755a2fe1109089d35f3f4
Fix an issue where we would only list manual projects in the unified job template api list
[ { "sha": "675007e2cc9b99b754c59aa78cb172c0e6fe0d14", "filename": "awx/main/access.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/6d2d0aa1a588cac8573755a2fe1109089d35f3f4/awx%2Fmain%2Faccess.py", "raw_url": "https://github.com/gconsidine/awx/raw/6d2d0aa1a588cac8573755a2fe1109089d35f3f4/awx%2Fmain%2Faccess.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=6d2d0aa1a588cac8573755a2fe1109089d35f3f4", "patch": "@@ -1086,7 +1086,7 @@ class UnifiedJobTemplateAccess(BaseAccess):\n \n def get_queryset(self):\n qs = self.model.objects.filter(active=True).distinct()\n- project_qs = self.user.get_queryset(Project).filter(scm_type__in=('',))\n+ project_qs = self.user.get_queryset(Project).filter(scm_type__in=[s[0] for s in Project.SCM_TYPE_CHOICES])\n inventory_source_qs = self.user.get_queryset(InventorySource).filter(source__in=CLOUD_INVENTORY_SOURCES)\n job_template_qs = self.user.get_queryset(JobTemplate)\n qs = qs.filter(Q(Project___in=project_qs) |" } ]
awx
620fc56f576f0e9169ce81732307866f3e3a0ae8
c8bf994eb4ee19cb39916147a0fb39a16ced6839
awx/main/models/jobs.py
https://github.com/gconsidine/awx
true
false
true
@@ -286,7 +286,7 @@ class Job(UnifiedJob, JobOptions): def task_impact(self): # NOTE: We sorta have to assume the host count matches and that forks default to 5 from awx.main.models.inventory import Host - if obj.launch_type == 'callback': + if self.launch_type == 'callback': count_hosts = 1 else: count_hosts = Host.objects.filter(inventory__jobs__pk=self.pk).count()
if obj . launch_type == 'callback' : count_hosts = 1 else : count_hosts = Host . objects . filter ( inventory__jobs__pk = self . pk ) . count ( )
if self . launch_type == 'callback' : count_hosts = 1 else : count_hosts = Host . objects . filter ( inventory__jobs__pk = self . pk ) . count ( )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:obj", 3, 12, 3, 15], "self"]]
gconsidine/awx@620fc56f576f0e9169ce81732307866f3e3a0ae8
Fix a reference issue in the task impact job determination logic
[ { "sha": "376cea4e5ad51ef85467238ee74e376f045ef91c", "filename": "awx/main/models/jobs.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/620fc56f576f0e9169ce81732307866f3e3a0ae8/awx%2Fmain%2Fmodels%2Fjobs.py", "raw_url": "https://github.com/gconsidine/awx/raw/620fc56f576f0e9169ce81732307866f3e3a0ae8/awx%2Fmain%2Fmodels%2Fjobs.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Fjobs.py?ref=620fc56f576f0e9169ce81732307866f3e3a0ae8", "patch": "@@ -286,7 +286,7 @@ def is_blocked_by(self, obj):\n def task_impact(self):\n # NOTE: We sorta have to assume the host count matches and that forks default to 5\n from awx.main.models.inventory import Host\n- if obj.launch_type == 'callback':\n+ if self.launch_type == 'callback':\n count_hosts = 1\n else:\n count_hosts = Host.objects.filter(inventory__jobs__pk=self.pk).count()" } ]
awx
6b8acae8b799c5139ba8c5a332dea12ab8cfedbf
ef04f453e7f0152551c452aa3efe7085ac688807
awx/main/management/commands/run_callback_receiver.py
https://github.com/gconsidine/awx
true
false
true
@@ -157,7 +157,7 @@ class CallbackReceiver(object): if event == 'playbook_on_stats': transaction.commit() print data - if verbose == 0 and res in data['event_data'] and 'invocation' in data['event_data']['res'] and \ + if verbose == 0 and 'res' in data['event_data'] and 'invocation' in data['event_data']['res'] and \ 'module_args' in data['event_data']['res']['invocation']: data['event_data']['res']['invocation']['module_args'] = "" job_event = JobEvent(**data)
if verbose == 0 and res in data [ 'event_data' ] and 'invocation' in data [ 'event_data' ] [ 'res' ] and 'module_args' in data [ 'event_data' ] [ 'res' ] [ 'invocation' ] : data [ 'event_data' ] [ 'res' ] [ 'invocation' ] [ 'module_args' ] = ""
if verbose == 0 and 'res' in data [ 'event_data' ] and 'invocation' in data [ 'event_data' ] [ 'res' ] and 'module_args' in data [ 'event_data' ] [ 'res' ] [ 'invocation' ] : data [ 'event_data' ] [ 'res' ] [ 'invocation' ] [ 'module_args' ] = ""
SINGLE_TOKEN
[["Insert", ["comparison_operator", 3, 37, 3, 62], ["string:'res'", "T"], 0], ["Delete", ["identifier:res", 3, 37, 3, 40]]]
gconsidine/awx@6b8acae8b799c5139ba8c5a332dea12ab8cfedbf
Incorrect identifier for 'res' in the callback receiver
[ { "sha": "a97bee793baca5aea7f174f3c0504eb29d35c7a8", "filename": "awx/main/management/commands/run_callback_receiver.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/6b8acae8b799c5139ba8c5a332dea12ab8cfedbf/awx%2Fmain%2Fmanagement%2Fcommands%2Frun_callback_receiver.py", "raw_url": "https://github.com/gconsidine/awx/raw/6b8acae8b799c5139ba8c5a332dea12ab8cfedbf/awx%2Fmain%2Fmanagement%2Fcommands%2Frun_callback_receiver.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmanagement%2Fcommands%2Frun_callback_receiver.py?ref=6b8acae8b799c5139ba8c5a332dea12ab8cfedbf", "patch": "@@ -157,7 +157,7 @@ def process_job_event(self, data):\n if event == 'playbook_on_stats':\n transaction.commit()\n print data\n- if verbose == 0 and res in data['event_data'] and 'invocation' in data['event_data']['res'] and \\\n+ if verbose == 0 and 'res' in data['event_data'] and 'invocation' in data['event_data']['res'] and \\\n 'module_args' in data['event_data']['res']['invocation']:\n data['event_data']['res']['invocation']['module_args'] = \"\"\n job_event = JobEvent(**data)" } ]
awx
a7f1202316d4af8d058dba58f7eae40d0accb2ee
a8952dd7964e81591928765694530030dfb3b6ca
awx/api/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -1447,7 +1447,7 @@ class JobTemplateSurveySpec(GenericAPIView): except ValueError, e: return Response(dict(error="Invalid JSON when parsing survey spec"), status=status.HTTP_400_BAD_REQUEST) if "name" not in obj.survey_spec: - return Response(dict(error="'name' missing from suvey spec"), status=status.HTTP_400_BAD_REQUEST) + return Response(dict(error="'name' missing from survey spec"), status=status.HTTP_400_BAD_REQUEST) if "description" not in obj.survey_spec: return Response(dict(error="'description' missing from survey spec"), status=status.HTTP_400_BAD_REQUEST) if "spec" not in obj.survey_spec:
return Response ( dict ( error = "'name' missing from suvey spec" ) , status = status . HTTP_400_BAD_REQUEST )
return Response ( dict ( error = "'name' missing from survey spec" ) , status = status . HTTP_400_BAD_REQUEST )
CHANGE_STRING_LITERAL
[["Update", ["string:\"'name' missing from suvey spec\"", 3, 40, 3, 72], "\"'name' missing from survey spec\""]]
gconsidine/awx@a7f1202316d4af8d058dba58f7eae40d0accb2ee
Fix spelling error in validation error message
[ { "sha": "ff9b5b1128aab25db53e2991c066fcf0f059b859", "filename": "awx/api/views.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/a7f1202316d4af8d058dba58f7eae40d0accb2ee/awx%2Fapi%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/a7f1202316d4af8d058dba58f7eae40d0accb2ee/awx%2Fapi%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=a7f1202316d4af8d058dba58f7eae40d0accb2ee", "patch": "@@ -1447,7 +1447,7 @@ def post(self, request, *args, **kwargs):\n except ValueError, e:\n return Response(dict(error=\"Invalid JSON when parsing survey spec\"), status=status.HTTP_400_BAD_REQUEST)\n if \"name\" not in obj.survey_spec:\n- return Response(dict(error=\"'name' missing from suvey spec\"), status=status.HTTP_400_BAD_REQUEST)\n+ return Response(dict(error=\"'name' missing from survey spec\"), status=status.HTTP_400_BAD_REQUEST)\n if \"description\" not in obj.survey_spec:\n return Response(dict(error=\"'description' missing from survey spec\"), status=status.HTTP_400_BAD_REQUEST)\n if \"spec\" not in obj.survey_spec:" } ]
awx
6258035ca8c6116a3f14c4ecc98db807067b799e
aa55f96316d217075e47dd18f0225c382a187b38
awx/api/serializers.py
https://github.com/gconsidine/awx
true
false
true
@@ -1308,7 +1308,7 @@ class JobOptionsSerializer(BaseSerializer): def validate_project(self, attrs, source): project = attrs.get('project', None) if not project and attrs.get('job_type') != PERM_INVENTORY_SCAN: - raise serializers.ValidationError("This field is required") + raise serializers.ValidationError("This field is required.") return attrs def validate_playbook(self, attrs, source):
raise serializers . ValidationError ( "This field is required" )
raise serializers . ValidationError ( "This field is required." )
CHANGE_STRING_LITERAL
[["Update", ["string:\"This field is required\"", 3, 47, 3, 71], "\"This field is required.\""]]
gconsidine/awx@6258035ca8c6116a3f14c4ecc98db807067b799e
Make ValidationError consistent with rest-framework This is silly, but rest-framework returns an error with a '.' at the end. Test automation validates the error responses. Rather than special case this condition, I've chosen to raise an Exception with a msg consistent with rest-framework.
[ { "sha": "8e5782a834399d09edb1be1df6412ee4937e03d4", "filename": "awx/api/serializers.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/6258035ca8c6116a3f14c4ecc98db807067b799e/awx%2Fapi%2Fserializers.py", "raw_url": "https://github.com/gconsidine/awx/raw/6258035ca8c6116a3f14c4ecc98db807067b799e/awx%2Fapi%2Fserializers.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=6258035ca8c6116a3f14c4ecc98db807067b799e", "patch": "@@ -1308,7 +1308,7 @@ def to_native(self, obj):\n def validate_project(self, attrs, source):\n project = attrs.get('project', None)\n if not project and attrs.get('job_type') != PERM_INVENTORY_SCAN:\n- raise serializers.ValidationError(\"This field is required\")\n+ raise serializers.ValidationError(\"This field is required.\")\n return attrs\n \n def validate_playbook(self, attrs, source):" } ]
awx
639522fc05e213e6e593c88dbe681cbba54e51e5
89bcffc9ad3951f84ff4634e359484bbfe1d3b14
awx/main/tests/jobs/jobs_monolithic.py
https://github.com/gconsidine/awx
true
false
true
@@ -787,7 +787,7 @@ class JobStartCancelTest(BaseJobTestMixin, django.test.LiveServerTestCase): job = self.make_job(self.jt_ops_east_run, self.user_sue, 'success') url = reverse('api:job_relaunch', args=(job.pk,)) with self.current_user(self.user_sue): - response = self.post(url, {}, expect=202) + response = self.post(url, {}, expect=201) j = Job.objects.get(pk=response['job']) self.assertTrue(j.status == 'successful') # Test with a job that prompts for SSH and sudo passwords.
response = self . post ( url , { } , expect = 202 )
response = self . post ( url , { } , expect = 201 )
CHANGE_NUMERIC_LITERAL
[["Update", ["integer:202", 3, 50, 3, 53], "201"]]
gconsidine/awx@639522fc05e213e6e593c88dbe681cbba54e51e5
Fix job relaunch test to expect 201.
[ { "sha": "1a1e6eda3d4b54a6b716a827d003339db7815c9d", "filename": "awx/main/tests/jobs/jobs_monolithic.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/639522fc05e213e6e593c88dbe681cbba54e51e5/awx%2Fmain%2Ftests%2Fjobs%2Fjobs_monolithic.py", "raw_url": "https://github.com/gconsidine/awx/raw/639522fc05e213e6e593c88dbe681cbba54e51e5/awx%2Fmain%2Ftests%2Fjobs%2Fjobs_monolithic.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Fjobs%2Fjobs_monolithic.py?ref=639522fc05e213e6e593c88dbe681cbba54e51e5", "patch": "@@ -787,7 +787,7 @@ def test_job_relaunch(self):\n job = self.make_job(self.jt_ops_east_run, self.user_sue, 'success')\n url = reverse('api:job_relaunch', args=(job.pk,))\n with self.current_user(self.user_sue):\n- response = self.post(url, {}, expect=202)\n+ response = self.post(url, {}, expect=201)\n j = Job.objects.get(pk=response['job'])\n self.assertTrue(j.status == 'successful')\n # Test with a job that prompts for SSH and sudo passwords." } ]
awx
1a54ed5e17a5effe073723679c7e278f67a463f1
639522fc05e213e6e593c88dbe681cbba54e51e5
awx/api/serializers.py
https://github.com/gconsidine/awx
true
false
false
@@ -409,7 +409,7 @@ class UnifiedJobTemplateSerializer(BaseSerializer): class UnifiedJobSerializer(BaseSerializer): result_stdout = serializers.Field(source='result_stdout') - unified_job_template = serializers.Field(source='unified_job_template') + unified_job_template = serializers.Field(source='unified_job_template_id') class Meta: model = UnifiedJob
unified_job_template = serializers . Field ( source = 'unified_job_template' )
unified_job_template = serializers . Field ( source = 'unified_job_template_id' )
CHANGE_STRING_LITERAL
[["Update", ["string:'unified_job_template'", 3, 53, 3, 75], "'unified_job_template_id'"]]
gconsidine/awx@1a54ed5e17a5effe073723679c7e278f67a463f1
Fix unified_job_template field in serializer to return ID.
[ { "sha": "b34a38617f465cff81e543a6f40b27f69797d423", "filename": "awx/api/serializers.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/1a54ed5e17a5effe073723679c7e278f67a463f1/awx%2Fapi%2Fserializers.py", "raw_url": "https://github.com/gconsidine/awx/raw/1a54ed5e17a5effe073723679c7e278f67a463f1/awx%2Fapi%2Fserializers.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=1a54ed5e17a5effe073723679c7e278f67a463f1", "patch": "@@ -409,7 +409,7 @@ def to_native(self, obj):\n class UnifiedJobSerializer(BaseSerializer):\n \n result_stdout = serializers.Field(source='result_stdout')\n- unified_job_template = serializers.Field(source='unified_job_template')\n+ unified_job_template = serializers.Field(source='unified_job_template_id')\n \n class Meta:\n model = UnifiedJob" } ]
awx
cec442ca4e1fa5beed80581d0620b3059bfd15d9
cffb2f324f82907ae082a2012e5d9a048b0c76b1
awx/fact/__init__.py
https://github.com/gconsidine/awx
true
false
false
@@ -17,4 +17,4 @@ try: connect(settings.MONGO_DB) register_key_transform(get_db()) except ConnectionError: - logger.warn('Failed to establish connect to MongDB "%s"' % (settings.MONGO_DB)) + logger.warn('Failed to establish connect to MongoDB "%s"' % (settings.MONGO_DB))
ConnectionError : logger . warn ( 'Failed to establish connect to MongDB "%s"' % ( settings . MONGO_DB ) )
ConnectionError : logger . warn ( 'Failed to establish connect to MongoDB "%s"' % ( settings . MONGO_DB ) )
CHANGE_BINARY_OPERAND
[["Update", ["string:'Failed to establish connect to MongDB \"%s\"'", 3, 17, 3, 61], "'Failed to establish connect to MongoDB \"%s\"'"]]
gconsidine/awx@cec442ca4e1fa5beed80581d0620b3059bfd15d9
Fixed mongodb spelling in log message
[ { "sha": "f9d5796ca2befff49ecf0dc13d01e0dd88850fa7", "filename": "awx/fact/__init__.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/cec442ca4e1fa5beed80581d0620b3059bfd15d9/awx%2Ffact%2F__init__.py", "raw_url": "https://github.com/gconsidine/awx/raw/cec442ca4e1fa5beed80581d0620b3059bfd15d9/awx%2Ffact%2F__init__.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Ffact%2F__init__.py?ref=cec442ca4e1fa5beed80581d0620b3059bfd15d9", "patch": "@@ -17,4 +17,4 @@\n connect(settings.MONGO_DB)\n register_key_transform(get_db())\n except ConnectionError:\n- logger.warn('Failed to establish connect to MongDB \"%s\"' % (settings.MONGO_DB))\n+ logger.warn('Failed to establish connect to MongoDB \"%s\"' % (settings.MONGO_DB))" } ]
awx
0af15cd13d41a3e5e5cfd3ebd8e01cd19c561dff
e017270201cd0fac5e28ffed5e72eca157b08b61
awx/main/tests/jobs/jobs_monolithic.py
https://github.com/gconsidine/awx
true
false
true
@@ -280,7 +280,7 @@ class JobTemplateTest(BaseJobTestMixin, django.test.TestCase): # Test that all required fields are really required. data['name'] = 'another new job template' - for field in ('name', 'job_type', 'inventory', 'project', 'playbook'): + for field in ('name', 'inventory', 'project', 'playbook'): with self.current_user(self.user_sue): d = dict(data.items()) d.pop(field)
for field in ( 'name' , 'job_type' , 'inventory' , 'project' , 'playbook' ) : with self . current_user ( self . user_sue ) : d = dict ( data . items ( ) ) d . pop ( field )
for field in ( 'name' , 'inventory' , 'project' , 'playbook' ) : with self . current_user ( self . user_sue ) : d = dict ( data . items ( ) ) d . pop ( field )
SINGLE_STMT
[["Move", [",:,", 3, 41, 3, 42], ["tuple", 3, 22, 3, 78], 5], ["Move", [",:,", 3, 54, 3, 55], ["tuple", 3, 22, 3, 78], 8], ["Delete", ["string:'job_type'", 3, 31, 3, 41]], ["Delete", [",:,", 3, 65, 3, 66]]]
gconsidine/awx@0af15cd13d41a3e5e5cfd3ebd8e01cd19c561dff
Unit test fix, job_type is no longer a required field (defaults to 'run').
[ { "sha": "589ae3bb8aaea6f67a48fbdc221f34932c0d0670", "filename": "awx/main/tests/jobs/jobs_monolithic.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/0af15cd13d41a3e5e5cfd3ebd8e01cd19c561dff/awx%2Fmain%2Ftests%2Fjobs%2Fjobs_monolithic.py", "raw_url": "https://github.com/gconsidine/awx/raw/0af15cd13d41a3e5e5cfd3ebd8e01cd19c561dff/awx%2Fmain%2Ftests%2Fjobs%2Fjobs_monolithic.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Fjobs%2Fjobs_monolithic.py?ref=0af15cd13d41a3e5e5cfd3ebd8e01cd19c561dff", "patch": "@@ -280,7 +280,7 @@ def test_post_job_template_list(self):\n \n # Test that all required fields are really required.\n data['name'] = 'another new job template'\n- for field in ('name', 'job_type', 'inventory', 'project', 'playbook'):\n+ for field in ('name', 'inventory', 'project', 'playbook'):\n with self.current_user(self.user_sue):\n d = dict(data.items())\n d.pop(field)" } ]
awx
1388ad4cc06229dcaaa12e2434eaf5b4eccb0936
f7081074d04c24196f7a3ee485707e69b642d9f5
awx/main/utils.py
https://github.com/gconsidine/awx
true
false
true
@@ -270,7 +270,7 @@ def model_to_dict(obj): attr_d = {} for field in obj._meta.fields: # FIXME: This needs to be aware of fields not to be included in the AS delta log - if field not in Credential.PASSWORD_FIELDS: + if field.name not in Credential.PASSWORD_FIELDS: attr_d[field.name] = str(getattr(obj, field.name, None)) else: attr_d[field.name] = "hidden"
if field not in Credential . PASSWORD_FIELDS : attr_d [ field . name ] = str ( getattr ( obj , field . name , None ) ) else : attr_d [ field . name ] = "hidden"
if field . name not in Credential . PASSWORD_FIELDS : attr_d [ field . name ] = str ( getattr ( obj , field . name , None ) ) else : attr_d [ field . name ] = "hidden"
ADD_ATTRIBUTE_ACCESS
[["Insert", ["comparison_operator", 3, 12, 3, 51], ["attribute", "N0"], 0], ["Move", "N0", ["identifier:field", 3, 12, 3, 17], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:name", "T"], 2]]
gconsidine/awx@1388ad4cc06229dcaaa12e2434eaf5b4eccb0936
Fix issue AC-677, field is referenced incorrectly causing exception
[ { "sha": "fc5005ff1274cc08ab85a1077c37a5c30b2fd031", "filename": "awx/main/utils.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/1388ad4cc06229dcaaa12e2434eaf5b4eccb0936/awx%2Fmain%2Futils.py", "raw_url": "https://github.com/gconsidine/awx/raw/1388ad4cc06229dcaaa12e2434eaf5b4eccb0936/awx%2Fmain%2Futils.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Futils.py?ref=1388ad4cc06229dcaaa12e2434eaf5b4eccb0936", "patch": "@@ -270,7 +270,7 @@ def model_to_dict(obj):\n attr_d = {}\n for field in obj._meta.fields:\n # FIXME: This needs to be aware of fields not to be included in the AS delta log\n- if field not in Credential.PASSWORD_FIELDS:\n+ if field.name not in Credential.PASSWORD_FIELDS:\n attr_d[field.name] = str(getattr(obj, field.name, None))\n else:\n attr_d[field.name] = \"hidden\"" } ]
awx
7fa9e3289b9af691e20adc8308a6ca6a67059a73
99726266e90bdf27f153f426a3632902144afae5
awx/api/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -164,7 +164,7 @@ class DashboardView(APIView): failed_group_inventory = [g.inventory for g in user_groups if g.inventory.has_active_failures] group_with_job_failure = 0 for i in failed_group_inventory: - for j in i.jobs: + for j in i.jobs.all(): if j.failed: group_with_job_failure += 1 break
for j in i . jobs : if j . failed : group_with_job_failure += 1 break
for j in i . jobs . all ( ) : if j . failed : group_with_job_failure += 1 break
ADD_METHOD_CALL
[["Insert", ["for_statement", 3, 13, 6, 26], ["call", "N0"], 3], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["attribute", 3, 22, 3, 28], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:all", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["):)", "T"], 1]]
gconsidine/awx@7fa9e3289b9af691e20adc8308a6ca6a67059a73
Fix RelatedManager exception issue on the dashboard
[ { "sha": "0ab654b7cb5fed456372d1142ac2055fa56982c1", "filename": "awx/api/views.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/7fa9e3289b9af691e20adc8308a6ca6a67059a73/awx%2Fapi%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/7fa9e3289b9af691e20adc8308a6ca6a67059a73/awx%2Fapi%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=7fa9e3289b9af691e20adc8308a6ca6a67059a73", "patch": "@@ -164,7 +164,7 @@ def get(self, request, format=None):\n failed_group_inventory = [g.inventory for g in user_groups if g.inventory.has_active_failures]\n group_with_job_failure = 0\n for i in failed_group_inventory:\n- for j in i.jobs:\n+ for j in i.jobs.all():\n if j.failed:\n group_with_job_failure += 1\n break" } ]
awx
3d7385bd1878bde222248ca69ad6b6eb9ad3c699
2dd2fb95ac642252201f7ace02814aac606b1da6
awx/api/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -224,7 +224,7 @@ class DashboardView(APIView): 'total': user_list.count()} data['organizations'] = {'url': reverse('api:organization_list'), 'total': organization_list.count()} - data['team'] = {'url': reverse('api:team_list'), + data['teams'] = {'url': reverse('api:team_list'), 'total': team_list.count()} data['credentials'] = {'url': reverse('api:credential_list'), 'total': credential_list.count()}
data [ 'team' ] = { 'url' : reverse ( 'api:team_list' ) , 'total' : team_list . count ( ) }
data [ 'teams' ] = { 'url' : reverse ( 'api:team_list' ) , 'total' : team_list . count ( ) }
CHANGE_STRING_LITERAL
[["Update", ["string:'team'", 3, 14, 3, 20], "'teams'"]]
gconsidine/awx@3d7385bd1878bde222248ca69ad6b6eb9ad3c699
Pluralize teams... fixes AC-738
[ { "sha": "33eb1c0f33eb1299ab467b7b9650c1c046b98dc7", "filename": "awx/api/views.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/3d7385bd1878bde222248ca69ad6b6eb9ad3c699/awx%2Fapi%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/3d7385bd1878bde222248ca69ad6b6eb9ad3c699/awx%2Fapi%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=3d7385bd1878bde222248ca69ad6b6eb9ad3c699", "patch": "@@ -224,7 +224,7 @@ def get(self, request, format=None):\n 'total': user_list.count()}\n data['organizations'] = {'url': reverse('api:organization_list'),\n 'total': organization_list.count()}\n- data['team'] = {'url': reverse('api:team_list'),\n+ data['teams'] = {'url': reverse('api:team_list'),\n 'total': team_list.count()}\n data['credentials'] = {'url': reverse('api:credential_list'),\n 'total': credential_list.count()}" } ]
awx
0b159e0ab49bc6162f36691417e91b6de36e7084
5bf3197680bfe6581692f9dcbaae060a446bc3bd
awx/api/serializers.py
https://github.com/gconsidine/awx
true
false
true
@@ -323,7 +323,7 @@ class ProjectSerializer(BaseSerializer): playbooks = reverse('api:project_playbooks', args=(obj.pk,)), update = reverse('api:project_update_view', args=(obj.pk,)), project_updates = reverse('api:project_updates_list', args=(obj.pk,)), - activity_list = reverse('api:project_activity_stream_list', args=(obj.pk,)), + activity_stream = reverse('api:project_activity_stream_list', args=(obj.pk,)), )) if obj.credential: res['credential'] = reverse('api:credential_detail',
activity_list = reverse ( 'api:project_activity_stream_list' , args = ( obj . pk , ) ) ,
activity_stream = reverse ( 'api:project_activity_stream_list' , args = ( obj . pk , ) ) ,
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:activity_list", 3, 13, 3, 26], "activity_stream"]]
gconsidine/awx@0b159e0ab49bc6162f36691417e91b6de36e7084
Fix the project related activity_stream which was mistakenly called activity_list
[ { "sha": "d94d64e3e5ea7d5bbd09eb257fc160be34581a9f", "filename": "awx/api/serializers.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/0b159e0ab49bc6162f36691417e91b6de36e7084/awx%2Fapi%2Fserializers.py", "raw_url": "https://github.com/gconsidine/awx/raw/0b159e0ab49bc6162f36691417e91b6de36e7084/awx%2Fapi%2Fserializers.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=0b159e0ab49bc6162f36691417e91b6de36e7084", "patch": "@@ -323,7 +323,7 @@ def get_related(self, obj):\n playbooks = reverse('api:project_playbooks', args=(obj.pk,)),\n update = reverse('api:project_update_view', args=(obj.pk,)),\n project_updates = reverse('api:project_updates_list', args=(obj.pk,)),\n- activity_list = reverse('api:project_activity_stream_list', args=(obj.pk,)),\n+ activity_stream = reverse('api:project_activity_stream_list', args=(obj.pk,)),\n ))\n if obj.credential:\n res['credential'] = reverse('api:credential_detail'," } ]
awx
43ecfc0a8749afc53733a53cc0897163189ad60d
7b113f492420472d1cd109e09c77a3494f326d8b
awx/main/management/commands/run_socketio_service.py
https://github.com/gconsidine/awx
true
false
true
@@ -84,7 +84,7 @@ class JobEventNamespace(TowerBaseNamespace): def get_initial_acl(self): valid_user = self.valid_user() - if valid_user is None: + if valid_user is None or valid_user is False: return set() else: user_jobs = get_user_queryset(valid_user, Job).filter(finished__isnull=True)
if valid_user is None : return set ( ) else : user_jobs = get_user_queryset ( valid_user , Job ) . filter ( finished__isnull = True )
if valid_user is None or valid_user is False : return set ( ) else : user_jobs = get_user_queryset ( valid_user , Job ) . filter ( finished__isnull = True )
LESS_SPECIFIC_IF
[["Insert", ["if_statement", 3, 9, 6, 89], ["boolean_operator", "N0"], 1], ["Move", "N0", ["comparison_operator", 3, 12, 3, 30], 0], ["Insert", "N0", ["or:or", "T"], 1], ["Insert", "N0", ["comparison_operator", "N1"], 2], ["Insert", "N1", ["identifier:valid_user", "T"], 0], ["Insert", "N1", ["is:is", "T"], 1], ["Insert", "N1", ["false:False", "T"], 2]]
gconsidine/awx@43ecfc0a8749afc53733a53cc0897163189ad60d
Fix a small bug related to return state when determining valid user on the socket io service
[ { "sha": "c2b086922742eacf60c2d9e19e5836d4f7eefd41", "filename": "awx/main/management/commands/run_socketio_service.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/43ecfc0a8749afc53733a53cc0897163189ad60d/awx%2Fmain%2Fmanagement%2Fcommands%2Frun_socketio_service.py", "raw_url": "https://github.com/gconsidine/awx/raw/43ecfc0a8749afc53733a53cc0897163189ad60d/awx%2Fmain%2Fmanagement%2Fcommands%2Frun_socketio_service.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmanagement%2Fcommands%2Frun_socketio_service.py?ref=43ecfc0a8749afc53733a53cc0897163189ad60d", "patch": "@@ -84,7 +84,7 @@ class JobEventNamespace(TowerBaseNamespace):\n \n def get_initial_acl(self):\n valid_user = self.valid_user()\n- if valid_user is None:\n+ if valid_user is None or valid_user is False:\n return set()\n else:\n user_jobs = get_user_queryset(valid_user, Job).filter(finished__isnull=True)" } ]
awx
ca5689c8ad3917f7df18499647f5fd156b68f56d
bb5dc1b9f91723b50ce85cf31f669817ed326d56
awx/main/models/projects.py
https://github.com/gconsidine/awx
true
false
true
@@ -302,7 +302,7 @@ class Project(UnifiedJobTemplate, ProjectOptions): def cache_timeout_blocked(self): if not self.last_job_run: return False - if (self.last_job_run + datetime.timedelta(seconds=self.update_cache_timeout)) > now(): + if (self.last_job_run + datetime.timedelta(seconds=self.scm_update_cache_timeout)) > now(): return True return False
if ( self . last_job_run + datetime . timedelta ( seconds = self . update_cache_timeout ) ) > now ( ) : return True
if ( self . last_job_run + datetime . timedelta ( seconds = self . scm_update_cache_timeout ) ) > now ( ) : return True
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:update_cache_timeout", 3, 65, 3, 85], "scm_update_cache_timeout"]]
gconsidine/awx@ca5689c8ad3917f7df18499647f5fd156b68f56d
Fix a bug where checking cache timeout blackout could fail on projects
[ { "sha": "117d7d1dfb4f37fdd6140644ec2515057853bf59", "filename": "awx/main/models/projects.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/ca5689c8ad3917f7df18499647f5fd156b68f56d/awx%2Fmain%2Fmodels%2Fprojects.py", "raw_url": "https://github.com/gconsidine/awx/raw/ca5689c8ad3917f7df18499647f5fd156b68f56d/awx%2Fmain%2Fmodels%2Fprojects.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Fprojects.py?ref=ca5689c8ad3917f7df18499647f5fd156b68f56d", "patch": "@@ -302,7 +302,7 @@ def create_project_update(self, **kwargs):\n def cache_timeout_blocked(self):\n if not self.last_job_run:\n return False\n- if (self.last_job_run + datetime.timedelta(seconds=self.update_cache_timeout)) > now():\n+ if (self.last_job_run + datetime.timedelta(seconds=self.scm_update_cache_timeout)) > now():\n return True\n return False\n " } ]
awx
875cef12e3d22ffe1b9fbd6c59491a0082f4f5a0
cfbec378c33f2eca4c03b7d0f5aa587524dab961
awx/main/models/unified_jobs.py
https://github.com/gconsidine/awx
true
false
true
@@ -301,7 +301,7 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique): continue # Foreign keys can be specified as field_name or field_name_id. if hasattr(self, '%s_id' % field_name) and ('%s_id' % field_name) in kwargs: - create_kwargs['%s_id' % field_name] = kwargs['%s_id' % field_name] = kwargs[field_name] + create_kwargs['%s_id' % field_name] = kwargs['%s_id' % field_name] = kwargs["%s_id" % field_name] continue create_kwargs[field_name] = getattr(self, field_name) kwargs = self._update_unified_job_kwargs(**create_kwargs)
create_kwargs [ '%s_id' % field_name ] = kwargs [ '%s_id' % field_name ] = kwargs [ field_name ]
create_kwargs [ '%s_id' % field_name ] = kwargs [ '%s_id' % field_name ] = kwargs [ "%s_id" % field_name ]
SINGLE_STMT
[["Insert", ["subscript", 3, 86, 3, 104], ["binary_operator", "N0"], 2], ["Insert", "N0", ["string:\"%s_id\"", "T"], 0], ["Insert", "N0", ["%:%", "T"], 1], ["Move", "N0", ["identifier:field_name", 3, 93, 3, 103], 2]]
gconsidine/awx@875cef12e3d22ffe1b9fbd6c59491a0082f4f5a0
Fix a bug in how I'm handling ids when creating a unified job as part of the launch process
[ { "sha": "80e31d7e78d4eaf87f39e55d348178da786491be", "filename": "awx/main/models/unified_jobs.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/875cef12e3d22ffe1b9fbd6c59491a0082f4f5a0/awx%2Fmain%2Fmodels%2Funified_jobs.py", "raw_url": "https://github.com/gconsidine/awx/raw/875cef12e3d22ffe1b9fbd6c59491a0082f4f5a0/awx%2Fmain%2Fmodels%2Funified_jobs.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Funified_jobs.py?ref=875cef12e3d22ffe1b9fbd6c59491a0082f4f5a0", "patch": "@@ -301,7 +301,7 @@ def create_unified_job(self, **kwargs):\n continue\n # Foreign keys can be specified as field_name or field_name_id.\n if hasattr(self, '%s_id' % field_name) and ('%s_id' % field_name) in kwargs:\n- create_kwargs['%s_id' % field_name] = kwargs['%s_id' % field_name] = kwargs[field_name]\n+ create_kwargs['%s_id' % field_name] = kwargs['%s_id' % field_name] = kwargs[\"%s_id\" % field_name]\n continue\n create_kwargs[field_name] = getattr(self, field_name)\n kwargs = self._update_unified_job_kwargs(**create_kwargs)" } ]
awx
91a1d8f761be6818a91b8d831725e5ab1b8d2b16
47ab0fe06ec0250d3d58280c242df767facc3605
awx/main/models/jobs.py
https://github.com/gconsidine/awx
true
false
true
@@ -198,7 +198,7 @@ class JobTemplate(UnifiedJobTemplate, JobOptions): def _get_unified_job_field_names(cls): return ['name', 'description', 'job_type', 'inventory', 'project', 'playbook', 'credential', 'cloud_credential', 'forks', - 'limit', 'verbosity', 'extra_vars', 'job_tags', + 'limit', 'verbosity', 'extra_vars', 'job_tags', 'launch_type', 'force_handlers', 'skip_tags', 'start_at_task'] def create_job(self, **kwargs):
return [ 'name' , 'description' , 'job_type' , 'inventory' , 'project' , 'playbook' , 'credential' , 'cloud_credential' , 'forks' , 'limit' , 'verbosity' , 'extra_vars' , 'job_tags' , 'force_handlers' , 'skip_tags' , 'start_at_task' ]
return [ 'name' , 'description' , 'job_type' , 'inventory' , 'project' , 'playbook' , 'credential' , 'cloud_credential' , 'forks' , 'limit' , 'verbosity' , 'extra_vars' , 'job_tags' , 'launch_type' , 'force_handlers' , 'skip_tags' , 'start_at_task' ]
ADD_ELEMENTS_TO_ITERABLE
[["Move", [",:,", 1, 23, 1, 24], ["list", 1, 16, 4, 64], 27], ["Insert", ["list", 1, 16, 4, 64], [",:,", "T"], 2], ["Insert", ["list", 1, 16, 4, 64], ["string:'launch_type'", "T"], 28], ["Insert", ["list", 1, 16, 4, 64], [",:,", "T"], 29], ["Delete", [",:,", 4, 33, 4, 34]]]
gconsidine/awx@91a1d8f761be6818a91b8d831725e5ab1b8d2b16
Fix a bug where listing the unified job fields did not include the 'launch_type' parameter, causing failing unit tests
[ { "sha": "32361f64a46ac14beba113891cd7c9a4e491816a", "filename": "awx/main/models/jobs.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/91a1d8f761be6818a91b8d831725e5ab1b8d2b16/awx%2Fmain%2Fmodels%2Fjobs.py", "raw_url": "https://github.com/gconsidine/awx/raw/91a1d8f761be6818a91b8d831725e5ab1b8d2b16/awx%2Fmain%2Fmodels%2Fjobs.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Fjobs.py?ref=91a1d8f761be6818a91b8d831725e5ab1b8d2b16", "patch": "@@ -198,7 +198,7 @@ def _get_unified_job_class(cls):\n def _get_unified_job_field_names(cls):\n return ['name', 'description', 'job_type', 'inventory', 'project',\n 'playbook', 'credential', 'cloud_credential', 'forks',\n- 'limit', 'verbosity', 'extra_vars', 'job_tags',\n+ 'limit', 'verbosity', 'extra_vars', 'job_tags', 'launch_type',\n 'force_handlers', 'skip_tags', 'start_at_task']\n \n def create_job(self, **kwargs):" } ]
awx
688e80d82cc5af29ba76e13cbbfa9e20486b069c
b4be8f7d49e3b420b9f42bbcbd40ee046c7f8aa6
awx/main/tests/tasks.py
https://github.com/gconsidine/awx
true
false
true
@@ -905,7 +905,7 @@ class RunJobTest(BaseCeleryTest): def test_lots_of_extra_vars(self): self.create_test_project(TEST_EXTRA_VARS_PLAYBOOK) - extra_vars = dict(('var_%d' % x, x) for x in xrange(200)) + extra_vars = json.dumps(dict(('var_%d' % x, x) for x in xrange(200))) job_template = self.create_test_job_template(extra_vars=extra_vars) job = self.create_test_job(job_template=job_template) self.assertEqual(job.status, 'new')
extra_vars = dict ( ( 'var_%d' % x , x ) for x in xrange ( 200 ) )
extra_vars = json . dumps ( dict ( ( 'var_%d' % x , x ) for x in xrange ( 200 ) ) )
ADD_FUNCTION_AROUND_EXPRESSION
[["Insert", ["call", 3, 22, 3, 66], ["attribute", "N0"], 0], ["Insert", ["call", 3, 22, 3, 66], ["argument_list", "N1"], 1], ["Insert", "N0", ["identifier:json", "T"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:dumps", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["call", 3, 22, 3, 66], 1], ["Insert", "N1", ["):)", "T"], 2]]
gconsidine/awx@688e80d82cc5af29ba76e13cbbfa9e20486b069c
One more extra vars fix.
[ { "sha": "3d4f392d2136abe1c0ab66575c59df74abb2dce2", "filename": "awx/main/tests/tasks.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/688e80d82cc5af29ba76e13cbbfa9e20486b069c/awx%2Fmain%2Ftests%2Ftasks.py", "raw_url": "https://github.com/gconsidine/awx/raw/688e80d82cc5af29ba76e13cbbfa9e20486b069c/awx%2Fmain%2Ftests%2Ftasks.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Ftasks.py?ref=688e80d82cc5af29ba76e13cbbfa9e20486b069c", "patch": "@@ -905,7 +905,7 @@ def test_extra_job_options(self):\n \n def test_lots_of_extra_vars(self):\n self.create_test_project(TEST_EXTRA_VARS_PLAYBOOK)\n- extra_vars = dict(('var_%d' % x, x) for x in xrange(200))\n+ extra_vars = json.dumps(dict(('var_%d' % x, x) for x in xrange(200)))\n job_template = self.create_test_job_template(extra_vars=extra_vars)\n job = self.create_test_job(job_template=job_template)\n self.assertEqual(job.status, 'new')" } ]
awx
a8390070c1671b528ac0c0eacce4b2a39badfe19
8afe8517fdea6c1f15b5aefc95f766dcd90a6cd7
awx/main/models/projects.py
https://github.com/gconsidine/awx
true
false
true
@@ -238,7 +238,7 @@ class Project(UnifiedJobTemplate, ProjectOptions): # Create auto-generated local path if project uses SCM. if self.pk and self.scm_type and not self.local_path.startswith('_'): slug_name = slugify(unicode(self.name)).replace(u'-', u'_') - self.local_path = u'_%d__%s' % (self.pk, slug_name) + self.local_path = u'_%d__%s' % (int(self.pk), slug_name) if 'local_path' not in update_fields: update_fields.append('local_path') # Do the actual save.
self . local_path = u'_%d__%s' % ( self . pk , slug_name )
self . local_path = u'_%d__%s' % ( int ( self . pk ) , slug_name )
ADD_FUNCTION_AROUND_EXPRESSION
[["Insert", ["tuple", 3, 44, 3, 64], ["call", "N0"], 1], ["Insert", "N0", ["identifier:int", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["attribute", 3, 45, 3, 52], 1], ["Insert", "N1", ["):)", "T"], 2]]
gconsidine/awx@a8390070c1671b528ac0c0eacce4b2a39badfe19
Explicitly typecast self.pk.
[ { "sha": "4930494a3daecba2587311eebbc7c07ce57c86dd", "filename": "awx/main/models/projects.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/a8390070c1671b528ac0c0eacce4b2a39badfe19/awx%2Fmain%2Fmodels%2Fprojects.py", "raw_url": "https://github.com/gconsidine/awx/raw/a8390070c1671b528ac0c0eacce4b2a39badfe19/awx%2Fmain%2Fmodels%2Fprojects.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Fprojects.py?ref=a8390070c1671b528ac0c0eacce4b2a39badfe19", "patch": "@@ -238,7 +238,7 @@ def save(self, *args, **kwargs):\n # Create auto-generated local path if project uses SCM.\n if self.pk and self.scm_type and not self.local_path.startswith('_'):\n slug_name = slugify(unicode(self.name)).replace(u'-', u'_')\n- self.local_path = u'_%d__%s' % (self.pk, slug_name)\n+ self.local_path = u'_%d__%s' % (int(self.pk), slug_name)\n if 'local_path' not in update_fields:\n update_fields.append('local_path')\n # Do the actual save." } ]
awx
b1b9fdede503f7f67e2c90307ec2236f303f9100
f7706c38082d3c0dd681d79c54b19ec9edca4bf9
awx/api/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -1483,7 +1483,8 @@ class JobTemplateLaunch(GenericAPIView): new_job = obj.create_unified_job(**request.DATA) result = new_job.signal_start(**request.DATA) if not result: - data = dict(passwords_needed_to_start=obj.passwords_needed_to_start) + data = dict(passwords_needed_to_start=new_job.passwords_needed_to_start) + # TODO, this scenario leaves an orphaned "new" job. Should we delete it? return Response(data, status=status.HTTP_400_BAD_REQUEST) else: data = dict(job=new_job.id)
data = dict ( passwords_needed_to_start = obj . passwords_needed_to_start )
data = dict ( passwords_needed_to_start = new_job . passwords_needed_to_start )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:obj", 3, 51, 3, 54], "new_job"]]
gconsidine/awx@b1b9fdede503f7f67e2c90307ec2236f303f9100
Fix a bug where, when launching a job without a credential and subsequently supplying the credential we weren't able to pick up any ASK fields that we needed credentials for
[ { "sha": "95fc634e7ba3858ec82beafbdc437f1814fae3d0", "filename": "awx/api/views.py", "status": "modified", "additions": 2, "deletions": 1, "changes": 3, "blob_url": "https://github.com/gconsidine/awx/blob/b1b9fdede503f7f67e2c90307ec2236f303f9100/awx%2Fapi%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/b1b9fdede503f7f67e2c90307ec2236f303f9100/awx%2Fapi%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=b1b9fdede503f7f67e2c90307ec2236f303f9100", "patch": "@@ -1483,7 +1483,8 @@ def post(self, request, *args, **kwargs):\n new_job = obj.create_unified_job(**request.DATA)\n result = new_job.signal_start(**request.DATA)\n if not result:\n- data = dict(passwords_needed_to_start=obj.passwords_needed_to_start)\n+ data = dict(passwords_needed_to_start=new_job.passwords_needed_to_start)\n+ # TODO, this scenario leaves an orphaned \"new\" job. Should we delete it?\n return Response(data, status=status.HTTP_400_BAD_REQUEST)\n else:\n data = dict(job=new_job.id)" } ]
awx
96433b07d41e20b0338afc22e9abd4b5bf88f871
1c1aa1f80731aeab3c8d7ac0c2d253968685c9be
awx/main/access.py
https://github.com/gconsidine/awx
true
false
true
@@ -1471,7 +1471,7 @@ class CustomInventoryScriptAccess(BaseAccess): def can_read(self, obj): if self.user.is_superuser: return True - if not self.active: + if not obj.active: return False return bool(obj.organization in self.user.organizations.all() or obj.organization in self.user.admin_of_organizations.all())
if not self . active : return False
if not obj . active : return False
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:self", 3, 16, 3, 20], "obj"]]
gconsidine/awx@96433b07d41e20b0338afc22e9abd4b5bf88f871
Incorrect object reference in Custom Inventory Script read acl for non-super-users
[ { "sha": "2159af6c5bec51389726999d17ac192e1929f515", "filename": "awx/main/access.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/96433b07d41e20b0338afc22e9abd4b5bf88f871/awx%2Fmain%2Faccess.py", "raw_url": "https://github.com/gconsidine/awx/raw/96433b07d41e20b0338afc22e9abd4b5bf88f871/awx%2Fmain%2Faccess.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=96433b07d41e20b0338afc22e9abd4b5bf88f871", "patch": "@@ -1471,7 +1471,7 @@ def get_queryset(self):\n def can_read(self, obj):\n if self.user.is_superuser:\n return True\n- if not self.active:\n+ if not obj.active:\n return False\n return bool(obj.organization in self.user.organizations.all() or obj.organization in self.user.admin_of_organizations.all())\n " } ]
awx
eaee8d76c454da766cb49e2e4629498703fd12b1
312c76788d9e38fa82265417e9c8efb5ce372722
awx/main/management/commands/inventory_import.py
https://github.com/gconsidine/awx
true
false
false
@@ -472,7 +472,7 @@ def load_inventory_source(source, all_group=None, group_filter_re=None, if filename.endswith(".ini") or os.path.isdir(filename): continue load_inventory_source(filename, all_group, group_filter_re, - host_filter_re) + host_filter_re, is_custom=is_custom) else: all_group = all_group or MemGroup('all', os.path.dirname(source)) if os.access(source, os.X_OK):
load_inventory_source ( filename , all_group , group_filter_re , host_filter_re )
load_inventory_source ( filename , all_group , group_filter_re , host_filter_re , is_custom = is_custom )
SAME_FUNCTION_MORE_ARGS
[["Move", [",:,", 2, 43, 2, 44], ["argument_list", 2, 34, 3, 50], 7], ["Insert", ["argument_list", 2, 34, 3, 50], [",:,", "T"], 2], ["Insert", ["argument_list", 2, 34, 3, 50], ["keyword_argument", "N0"], 4], ["Insert", "N0", ["identifier:is_custom", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["identifier:is_custom", "T"], 2]]
gconsidine/awx@eaee8d76c454da766cb49e2e4629498703fd12b1
Fix a bug launching a custom inventory script under proot where we would never actually launch the job under proot
[ { "sha": "8455f92befa2711472c9f7c7482451a5795f31f3", "filename": "awx/main/management/commands/inventory_import.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/eaee8d76c454da766cb49e2e4629498703fd12b1/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "raw_url": "https://github.com/gconsidine/awx/raw/eaee8d76c454da766cb49e2e4629498703fd12b1/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py?ref=eaee8d76c454da766cb49e2e4629498703fd12b1", "patch": "@@ -472,7 +472,7 @@ def load_inventory_source(source, all_group=None, group_filter_re=None,\n if filename.endswith(\".ini\") or os.path.isdir(filename):\n continue\n load_inventory_source(filename, all_group, group_filter_re,\n- host_filter_re)\n+ host_filter_re, is_custom=is_custom)\n else:\n all_group = all_group or MemGroup('all', os.path.dirname(source))\n if os.access(source, os.X_OK):" } ]
awx
8f4cd58a5e371dc02f612b173184bfb8b088d8fb
d03fe93927f08565076851827fd8b6225845a914
awx/main/tests/base.py
https://github.com/gconsidine/awx
true
false
true
@@ -208,7 +208,7 @@ class BaseTestMixin(object): ) def make_projects(self, created_by, count=1, playbook_content='', - role_playbooks=None, unicode_prefix=True): + role_playbooks=None, unicode_prefix=False): results = [] for x in range(0, count): self.object_ctr = self.object_ctr + 1
def make_projects ( self , created_by , count = 1 , playbook_content = '' , role_playbooks = None , unicode_prefix = True ) : results = [ ] for x in range ( 0 , count ) : self . object_ctr = self . object_ctr + 1
def make_projects ( self , created_by , count = 1 , playbook_content = '' , role_playbooks = None , unicode_prefix = False ) : results = [ ] for x in range ( 0 , count ) : self . object_ctr = self . object_ctr + 1
CHANGE_BOOLEAN_LITERAL
[["Insert", ["default_parameter", 3, 44, 3, 63], ["false:False", "T"], 2], ["Delete", ["true:True", 3, 59, 3, 63]]]
gconsidine/awx@8f4cd58a5e371dc02f612b173184bfb8b088d8fb
Bulk make_projects seems to have path concat issues when forcing unicode
[ { "sha": "ce27889065861d177a8b2a25b35e4731d83a11a9", "filename": "awx/main/tests/base.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/8f4cd58a5e371dc02f612b173184bfb8b088d8fb/awx%2Fmain%2Ftests%2Fbase.py", "raw_url": "https://github.com/gconsidine/awx/raw/8f4cd58a5e371dc02f612b173184bfb8b088d8fb/awx%2Fmain%2Ftests%2Fbase.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Fbase.py?ref=8f4cd58a5e371dc02f612b173184bfb8b088d8fb", "patch": "@@ -208,7 +208,7 @@ def make_project(self, name, description='', created_by=None,\n )\n \n def make_projects(self, created_by, count=1, playbook_content='',\n- role_playbooks=None, unicode_prefix=True):\n+ role_playbooks=None, unicode_prefix=False):\n results = []\n for x in range(0, count):\n self.object_ctr = self.object_ctr + 1" } ]
awx
719ae63a28a0fdbb379a5ee61a9bb3216ef283bc
0ffa7588e1353dcac3d136b6b25098d0f5eaeb05
awx/main/ha.py
https://github.com/gconsidine/awx
true
false
true
@@ -15,7 +15,7 @@ def is_ha_environment(): return True # If the database is not local, then we are in an HA environment. - host = settings.DATABASES['default'].get('host', 'localhost') + host = settings.DATABASES['default'].get('HOST', 'localhost') if host and host.lower() not in ('127.0.0.1', 'localhost'): return True
host = settings . DATABASES [ 'default' ] . get ( 'host' , 'localhost' )
host = settings . DATABASES [ 'default' ] . get ( 'HOST' , 'localhost' )
CHANGE_STRING_LITERAL
[["Update", ["string:'host'", 3, 46, 3, 52], "'HOST'"]]
gconsidine/awx@719ae63a28a0fdbb379a5ee61a9bb3216ef283bc
Fix error causing single-host HA environments to report not HA.
[ { "sha": "3d1294defdeaca1fd48729f5d89c642b1fc41ee5", "filename": "awx/main/ha.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/719ae63a28a0fdbb379a5ee61a9bb3216ef283bc/awx%2Fmain%2Fha.py", "raw_url": "https://github.com/gconsidine/awx/raw/719ae63a28a0fdbb379a5ee61a9bb3216ef283bc/awx%2Fmain%2Fha.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fha.py?ref=719ae63a28a0fdbb379a5ee61a9bb3216ef283bc", "patch": "@@ -15,7 +15,7 @@ def is_ha_environment():\n return True\n \n # If the database is not local, then we are in an HA environment.\n- host = settings.DATABASES['default'].get('host', 'localhost')\n+ host = settings.DATABASES['default'].get('HOST', 'localhost')\n if host and host.lower() not in ('127.0.0.1', 'localhost'):\n return True\n " } ]
awx
45a7c1647fd1a8f95255f71fe56384f6cea41f4a
a130ac88dd34b20d51b4d2f88b28937a33603c94
awx/api/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -1488,7 +1488,7 @@ class JobTemplateLaunch(GenericAPIView): request_data = request.DATA validation_errors = obj.survey_variable_validation(request_data.get('extra_vars', {})) if validation_errors: - return Response(dict(errors=validation_errors), + return Response(dict(variables_needed_to_start=validation_errors), status=status.HTTP_400_BAD_REQUEST) if obj.credential is None and ('credential' not in request.DATA and 'credential_id' not in request.DATA): return Response(dict(errors="Credential not provided"), status=status.HTTP_400_BAD_REQUEST)
return Response ( dict ( errors = validation_errors ) , status = status . HTTP_400_BAD_REQUEST )
return Response ( dict ( variables_needed_to_start = validation_errors ) , status = status . HTTP_400_BAD_REQUEST )
CHANGE_KEYWORD_ARGUMENT_USED
[["Update", ["identifier:errors", 3, 38, 3, 44], "variables_needed_to_start"]]
gconsidine/awx@45a7c1647fd1a8f95255f71fe56384f6cea41f4a
Fix error message returned based on variables_needed_to_start
[ { "sha": "9e1dabc501fcd53551b9dcaec7dde5e9d23ef09b", "filename": "awx/api/views.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/45a7c1647fd1a8f95255f71fe56384f6cea41f4a/awx%2Fapi%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/45a7c1647fd1a8f95255f71fe56384f6cea41f4a/awx%2Fapi%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=45a7c1647fd1a8f95255f71fe56384f6cea41f4a", "patch": "@@ -1488,7 +1488,7 @@ def post(self, request, *args, **kwargs):\n request_data = request.DATA\n validation_errors = obj.survey_variable_validation(request_data.get('extra_vars', {}))\n if validation_errors:\n- return Response(dict(errors=validation_errors),\n+ return Response(dict(variables_needed_to_start=validation_errors),\n status=status.HTTP_400_BAD_REQUEST)\n if obj.credential is None and ('credential' not in request.DATA and 'credential_id' not in request.DATA):\n return Response(dict(errors=\"Credential not provided\"), status=status.HTTP_400_BAD_REQUEST)" } ]
awx
6a7e887369505aabbf3ea9fe566303f97433ad17
ea8537ac71c9d6f20ca0a3c71887f2a199173a9f
awx/api/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -1503,7 +1503,7 @@ class JobTemplateSurveySpec(GenericAPIView): def post(self, request, *args, **kwargs): obj = self.get_object() - if not request.user.can_access(self.model, 'change', obj, request.DATA): + if not request.user.can_access(self.model, 'change', obj, None): raise PermissionDenied() try: obj.survey_spec = json.dumps(request.DATA)
if not request . user . can_access ( self . model , 'change' , obj , request . DATA ) : raise PermissionDenied ( )
if not request . user . can_access ( self . model , 'change' , obj , None ) : raise PermissionDenied ( )
SINGLE_STMT
[["Insert", ["argument_list", 3, 39, 3, 80], ["none:None", "T"], 7], ["Delete", ["identifier:request", 3, 67, 3, 74]], ["Delete", [".:.", 3, 74, 3, 75]], ["Delete", ["identifier:DATA", 3, 75, 3, 79]], ["Delete", ["attribute", 3, 67, 3, 79]]]
gconsidine/awx@6a7e887369505aabbf3ea9fe566303f97433ad17
Fix an issue where non super users would not be able to update a job template survey spec
[ { "sha": "8da406e83116b7ff08276fc1f9bd6408a176277d", "filename": "awx/api/views.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/6a7e887369505aabbf3ea9fe566303f97433ad17/awx%2Fapi%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/6a7e887369505aabbf3ea9fe566303f97433ad17/awx%2Fapi%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=6a7e887369505aabbf3ea9fe566303f97433ad17", "patch": "@@ -1503,7 +1503,7 @@ def get(self, request, *args, **kwargs):\n \n def post(self, request, *args, **kwargs):\n obj = self.get_object()\n- if not request.user.can_access(self.model, 'change', obj, request.DATA):\n+ if not request.user.can_access(self.model, 'change', obj, None):\n raise PermissionDenied()\n try:\n obj.survey_spec = json.dumps(request.DATA)" } ]
awx
8e22aafbed692baca872d9b18999fe195bcd3930
8da5ba60f3560fc7b25589c48feeb5298799cfdb
awx/main/tasks.py
https://github.com/gconsidine/awx
true
false
true
@@ -215,7 +215,7 @@ class BaseTask(Task): ) else: logger.error('Failed to update %s after %d retries.', - self.model._meta.object_name, retry_count) + self.model._meta.object_name, _attempt) def signal_finished(self, pk): pass
logger . error ( 'Failed to update %s after %d retries.' , self . model . _meta . object_name , retry_count )
logger . error ( 'Failed to update %s after %d retries.' , self . model . _meta . object_name , _attempt )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:retry_count", 3, 60, 3, 71], "_attempt"]]
gconsidine/awx@8e22aafbed692baca872d9b18999fe195bcd3930
fixed variable name error
[ { "sha": "7bda7d72a228699e1246a5f839a7ef9e6c2bd86b", "filename": "awx/main/tasks.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/8e22aafbed692baca872d9b18999fe195bcd3930/awx%2Fmain%2Ftasks.py", "raw_url": "https://github.com/gconsidine/awx/raw/8e22aafbed692baca872d9b18999fe195bcd3930/awx%2Fmain%2Ftasks.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftasks.py?ref=8e22aafbed692baca872d9b18999fe195bcd3930", "patch": "@@ -215,7 +215,7 @@ def update_model(self, pk, _attempt=0, **updates):\n )\n else:\n logger.error('Failed to update %s after %d retries.',\n- self.model._meta.object_name, retry_count)\n+ self.model._meta.object_name, _attempt)\n \n def signal_finished(self, pk):\n pass" } ]
awx
76ad9720dd72718c4f9fb503c3896ee69265677e
89b1ef62e6bf8d9366ff818f2108df3200db0fff
awx/main/models/inventory.py
https://github.com/gconsidine/awx
true
false
true
@@ -1219,7 +1219,7 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions): def save(self, *args, **kwargs): update_fields = kwargs.get('update_fields', []) - if bool('license' in self.result_stdout and + if bool(('license' in self.result_stdout or 'licensed' in self.result_stdout) and 'exceeded' in self.result_stdout and not self.license_error): self.license_error = True if 'license_error' not in update_fields:
if bool ( 'license' in self . result_stdout and 'exceeded' in self . result_stdout and not self . license_error ) : self . license_error = True if 'license_error' not in update_fields :
if bool ( ( 'license' in self . result_stdout or 'licensed' in self . result_stdout ) and 'exceeded' in self . result_stdout and not self . license_error ) : self . license_error = True if 'license_error' not in update_fields :
CHANGE_BINARY_OPERAND
[["Insert", ["boolean_operator", 3, 17, 4, 49], ["parenthesized_expression", "N0"], 0], ["Insert", "N0", ["(:(", "T"], 0], ["Insert", "N0", ["boolean_operator", "N1"], 1], ["Insert", "N0", ["):)", "T"], 2], ["Move", "N1", ["comparison_operator", 3, 17, 3, 48], 0], ["Insert", "N1", ["or:or", "T"], 1], ["Insert", "N1", ["comparison_operator", "N2"], 2], ["Insert", "N2", ["string:'licensed'", "T"], 0], ["Insert", "N2", ["in:in", "T"], 1], ["Insert", "N2", ["attribute", "N3"], 2], ["Insert", "N3", ["identifier:self", "T"], 0], ["Insert", "N3", [".:.", "T"], 1], ["Insert", "N3", ["identifier:result_stdout", "T"], 2]]
gconsidine/awx@76ad9720dd72718c4f9fb503c3896ee69265677e
fixed inventory source update # license hosts check
[ { "sha": "60e19724a0e03f6c6b21a5b6fc5e28df6fb6ab45", "filename": "awx/main/models/inventory.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/76ad9720dd72718c4f9fb503c3896ee69265677e/awx%2Fmain%2Fmodels%2Finventory.py", "raw_url": "https://github.com/gconsidine/awx/raw/76ad9720dd72718c4f9fb503c3896ee69265677e/awx%2Fmain%2Fmodels%2Finventory.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Finventory.py?ref=76ad9720dd72718c4f9fb503c3896ee69265677e", "patch": "@@ -1219,7 +1219,7 @@ def socketio_emit_data(self):\n \n def save(self, *args, **kwargs):\n update_fields = kwargs.get('update_fields', [])\n- if bool('license' in self.result_stdout and\n+ if bool(('license' in self.result_stdout or 'licensed' in self.result_stdout) and\n 'exceeded' in self.result_stdout and not self.license_error):\n self.license_error = True\n if 'license_error' not in update_fields:" } ]
awx
85743d225094c84b403df0500adb27998c5192d8
7fbdc1d0dbd39268e04aedc18ae59a63a0cc1884
awx/main/models/inventory.py
https://github.com/gconsidine/awx
true
false
true
@@ -1219,7 +1219,7 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions): def save(self, *args, **kwargs): update_fields = kwargs.get('update_fields', []) - if bool('license' in self.result_stdout and + if bool(('license' in self.result_stdout or 'licensed' in self.result_stdout) and 'exceeded' in self.result_stdout and not self.license_error): self.license_error = True if 'license_error' not in update_fields:
if bool ( 'license' in self . result_stdout and 'exceeded' in self . result_stdout and not self . license_error ) : self . license_error = True if 'license_error' not in update_fields :
if bool ( ( 'license' in self . result_stdout or 'licensed' in self . result_stdout ) and 'exceeded' in self . result_stdout and not self . license_error ) : self . license_error = True if 'license_error' not in update_fields :
CHANGE_BINARY_OPERAND
[["Insert", ["boolean_operator", 3, 17, 4, 49], ["parenthesized_expression", "N0"], 0], ["Insert", "N0", ["(:(", "T"], 0], ["Insert", "N0", ["boolean_operator", "N1"], 1], ["Insert", "N0", ["):)", "T"], 2], ["Move", "N1", ["comparison_operator", 3, 17, 3, 48], 0], ["Insert", "N1", ["or:or", "T"], 1], ["Insert", "N1", ["comparison_operator", "N2"], 2], ["Insert", "N2", ["string:'licensed'", "T"], 0], ["Insert", "N2", ["in:in", "T"], 1], ["Insert", "N2", ["attribute", "N3"], 2], ["Insert", "N3", ["identifier:self", "T"], 0], ["Insert", "N3", [".:.", "T"], 1], ["Insert", "N3", ["identifier:result_stdout", "T"], 2]]
gconsidine/awx@85743d225094c84b403df0500adb27998c5192d8
fixed inventory source update # license hosts check
[ { "sha": "60e19724a0e03f6c6b21a5b6fc5e28df6fb6ab45", "filename": "awx/main/models/inventory.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/85743d225094c84b403df0500adb27998c5192d8/awx%2Fmain%2Fmodels%2Finventory.py", "raw_url": "https://github.com/gconsidine/awx/raw/85743d225094c84b403df0500adb27998c5192d8/awx%2Fmain%2Fmodels%2Finventory.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Finventory.py?ref=85743d225094c84b403df0500adb27998c5192d8", "patch": "@@ -1219,7 +1219,7 @@ def socketio_emit_data(self):\n \n def save(self, *args, **kwargs):\n update_fields = kwargs.get('update_fields', [])\n- if bool('license' in self.result_stdout and\n+ if bool(('license' in self.result_stdout or 'licensed' in self.result_stdout) and\n 'exceeded' in self.result_stdout and not self.license_error):\n self.license_error = True\n if 'license_error' not in update_fields:" } ]
awx
fdb0dd29a9857612884373533029f638b74000b2
3162f62fa9d2af611793dbe0b6058d590f3064ad
lib/main/serializers.py
https://github.com/gconsidine/awx
true
false
true
@@ -168,7 +168,7 @@ class TeamSerializer(BaseSerializer): projects = reverse(lib.urls.views_TeamsProjectsList, args=(obj.pk,)), users = reverse(lib.urls.views_TeamsUsersList, args=(obj.pk,)), credentials = reverse(lib.urls.views_TeamsCredentialsList, args=(obj.pk,)), - organization = reverse(lib.urls.views_OrganizationsDetail, args=(obj.pk,)), + organization = reverse(lib.urls.views_OrganizationsDetail, args=(obj.organization.pk,)), ) if obj.created_by: res['created_by'] = reverse(lib.urls.views_UsersDetail, args=(obj.created_by.pk,))
organization = reverse ( lib . urls . views_OrganizationsDetail , args = ( obj . pk , ) ) ,
organization = reverse ( lib . urls . views_OrganizationsDetail , args = ( obj . organization . pk , ) ) ,
ADD_ATTRIBUTE_ACCESS
[["Insert", ["attribute", 3, 80, 3, 86], ["attribute", "N0"], 0], ["Insert", ["attribute", 3, 80, 3, 86], [".:.", "T"], 1], ["Move", "N0", ["identifier:obj", 3, 80, 3, 83], 0], ["Move", "N0", [".:.", 3, 83, 3, 84], 1], ["Insert", "N0", ["identifier:organization", "T"], 2]]
gconsidine/awx@fdb0dd29a9857612884373533029f638b74000b2
Fix organization lookup ID.
[ { "sha": "870db583cc90c467f9e0413e8097b2464a652349", "filename": "lib/main/serializers.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/fdb0dd29a9857612884373533029f638b74000b2/lib%2Fmain%2Fserializers.py", "raw_url": "https://github.com/gconsidine/awx/raw/fdb0dd29a9857612884373533029f638b74000b2/lib%2Fmain%2Fserializers.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/lib%2Fmain%2Fserializers.py?ref=fdb0dd29a9857612884373533029f638b74000b2", "patch": "@@ -168,7 +168,7 @@ def get_related(self, obj):\n projects = reverse(lib.urls.views_TeamsProjectsList, args=(obj.pk,)),\n users = reverse(lib.urls.views_TeamsUsersList, args=(obj.pk,)),\n credentials = reverse(lib.urls.views_TeamsCredentialsList, args=(obj.pk,)),\n- organization = reverse(lib.urls.views_OrganizationsDetail, args=(obj.pk,)),\n+ organization = reverse(lib.urls.views_OrganizationsDetail, args=(obj.organization.pk,)),\n )\n if obj.created_by:\n res['created_by'] = reverse(lib.urls.views_UsersDetail, args=(obj.created_by.pk,))" } ]
awx
49ca140e306fc241bbd1d5e7c7bcc672e97bc426
9e9e41db35f103883d18d17deb667a04f3d224fc
ansibleworks/settings/defaults.py
https://github.com/gconsidine/awx
true
false
false
@@ -14,7 +14,7 @@ for setting in dir(global_settings): # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(__file__)) -DEBUG = False +DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = (
DEBUG = False
DEBUG = True
CHANGE_BOOLEAN_LITERAL
[["Insert", ["assignment", 3, 1, 3, 14], ["true:True", "T"], 2], ["Delete", ["false:False", 3, 9, 3, 14]]]
gconsidine/awx@49ca140e306fc241bbd1d5e7c7bcc672e97bc426
Set DEBUG back to True
[ { "sha": "a19c2569b19e8d4e6ed9256dbc37f7c26b2f72b2", "filename": "ansibleworks/settings/defaults.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/49ca140e306fc241bbd1d5e7c7bcc672e97bc426/ansibleworks%2Fsettings%2Fdefaults.py", "raw_url": "https://github.com/gconsidine/awx/raw/49ca140e306fc241bbd1d5e7c7bcc672e97bc426/ansibleworks%2Fsettings%2Fdefaults.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/ansibleworks%2Fsettings%2Fdefaults.py?ref=49ca140e306fc241bbd1d5e7c7bcc672e97bc426", "patch": "@@ -14,7 +14,7 @@\n # Build paths inside the project like this: os.path.join(BASE_DIR, ...)\n BASE_DIR = os.path.dirname(os.path.dirname(__file__))\n \n-DEBUG = False\n+DEBUG = True\n TEMPLATE_DEBUG = DEBUG\n \n ADMINS = (" } ]
awx
689765c587cacac7474757a6f3d44e18b56d2851
adcc4029101862965455b60c8163541d7a5d7bc2
awx/main/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -629,7 +629,7 @@ class UserDetail(BaseDetail): if changed: raise PermissionDenied('Cannot change %s' % ', '.join(changed.keys())) - if 'password' in request.DATA: + if 'password' in request.DATA and request.DATA['password']: obj.set_password(request.DATA['password']) obj.save() request.DATA.pop('password')
if 'password' in request . DATA : obj . set_password ( request . DATA [ 'password' ] ) obj . save ( ) request . DATA . pop ( 'password' )
if 'password' in request . DATA and request . DATA [ 'password' ] : obj . set_password ( request . DATA [ 'password' ] ) obj . save ( ) request . DATA . pop ( 'password' )
MORE_SPECIFIC_IF
[["Insert", ["if_statement", 3, 9, 6, 41], ["boolean_operator", "N0"], 1], ["Move", "N0", ["comparison_operator", 3, 12, 3, 38], 0], ["Insert", "N0", ["and:and", "T"], 1], ["Insert", "N0", ["subscript", "N1"], 2], ["Insert", "N1", ["attribute", "N2"], 0], ["Insert", "N1", ["[:[", "T"], 1], ["Insert", "N1", ["string:'password'", "T"], 2], ["Insert", "N1", ["]:]", "T"], 3], ["Insert", "N2", ["identifier:request", "T"], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:DATA", "T"], 2]]
gconsidine/awx@689765c587cacac7474757a6f3d44e18b56d2851
Fix to only update the user's password if a non-empty password string is provided.
[ { "sha": "bc1e409cd5a1744dfbae9712ed0d571cd0c53e69", "filename": "awx/main/views.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/689765c587cacac7474757a6f3d44e18b56d2851/awx%2Fmain%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/689765c587cacac7474757a6f3d44e18b56d2851/awx%2Fmain%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fviews.py?ref=689765c587cacac7474757a6f3d44e18b56d2851", "patch": "@@ -629,7 +629,7 @@ def put_filter(self, request, *args, **kwargs):\n if changed:\n raise PermissionDenied('Cannot change %s' % ', '.join(changed.keys()))\n \n- if 'password' in request.DATA:\n+ if 'password' in request.DATA and request.DATA['password']:\n obj.set_password(request.DATA['password'])\n obj.save()\n request.DATA.pop('password')" } ]
awx
259083c0e2149148d363bfa5e5a26ffb1bfaaf64
dfb864981aba1f3457e05a3ff37e3250be6bcc12
awx/main/tasks.py
https://github.com/gconsidine/awx
true
false
true
@@ -93,7 +93,7 @@ class RunJob(Task): # do not want AWX to ask interactive questions and want it to be friendly with reprovisioning env['ANSIBLE_HOST_KEY_CHECKING'] = 'False' # RHEL has too old of an SSH so ansible will select paramiko and this is VERY slow - env['ANSIBLE_PARAMIKO_RECORD_HOST_KEYS'] = False + env['ANSIBLE_PARAMIKO_RECORD_HOST_KEYS'] = 'False' return env def build_args(self, job, **kwargs):
env [ 'ANSIBLE_PARAMIKO_RECORD_HOST_KEYS' ] = False
env [ 'ANSIBLE_PARAMIKO_RECORD_HOST_KEYS' ] = 'False'
CHANGE_CONSTANT_TYPE
[["Insert", ["assignment", 3, 9, 3, 57], ["string:'False'", "T"], 2], ["Delete", ["false:False", 3, 52, 3, 57]]]
gconsidine/awx@259083c0e2149148d363bfa5e5a26ffb1bfaaf64
Fix for jobs failing to run.
[ { "sha": "6c72fdaf40f50bf9933f49dc2a2f5ed1b39bb998", "filename": "awx/main/tasks.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/259083c0e2149148d363bfa5e5a26ffb1bfaaf64/awx%2Fmain%2Ftasks.py", "raw_url": "https://github.com/gconsidine/awx/raw/259083c0e2149148d363bfa5e5a26ffb1bfaaf64/awx%2Fmain%2Ftasks.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftasks.py?ref=259083c0e2149148d363bfa5e5a26ffb1bfaaf64", "patch": "@@ -93,7 +93,7 @@ def build_env(self, job, **kwargs):\n # do not want AWX to ask interactive questions and want it to be friendly with reprovisioning\n env['ANSIBLE_HOST_KEY_CHECKING'] = 'False'\n # RHEL has too old of an SSH so ansible will select paramiko and this is VERY slow\n- env['ANSIBLE_PARAMIKO_RECORD_HOST_KEYS'] = False\n+ env['ANSIBLE_PARAMIKO_RECORD_HOST_KEYS'] = 'False'\n return env\n \n def build_args(self, job, **kwargs):" } ]
awx
4d8b039074e72fbf6ef0a2f74b731f384010e541
d23e2345afaeb996e0b29defb90c477b94ce4118
awx/main/management/commands/inventory_import.py
https://github.com/gconsidine/awx
true
false
true
@@ -196,7 +196,7 @@ class IniLoader(BaseLoader): tokens = shlex.split(line) if input_mode == 'host': - new_host = MemHost(tokens[0], self.inventory_base) + new_host = self.get_host(tokens[0]) if len(tokens) > 1: variables = {} for t in tokens[1:]:
new_host = MemHost ( tokens [ 0 ] , self . inventory_base )
new_host = self . get_host ( tokens [ 0 ] )
SINGLE_STMT
[["Insert", ["call", 3, 33, 3, 72], ["attribute", "N0"], 0], ["Update", ["identifier:MemHost", 3, 33, 3, 40], "self"], ["Move", "N0", ["identifier:MemHost", 3, 33, 3, 40], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:get_host", "T"], 2], ["Delete", [",:,", 3, 50, 3, 51]], ["Delete", ["identifier:self", 3, 52, 3, 56]], ["Delete", [".:.", 3, 56, 3, 57]], ["Delete", ["identifier:inventory_base", 3, 57, 3, 71]], ["Delete", ["attribute", 3, 52, 3, 71]]]
gconsidine/awx@4d8b039074e72fbf6ef0a2f74b731f384010e541
Fix to use get_host so it shows up in the list of overall added hosts.
[ { "sha": "e1a769fdca03d44856b15e2ab0ca03eb411a1343", "filename": "awx/main/management/commands/inventory_import.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/4d8b039074e72fbf6ef0a2f74b731f384010e541/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "raw_url": "https://github.com/gconsidine/awx/raw/4d8b039074e72fbf6ef0a2f74b731f384010e541/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py?ref=4d8b039074e72fbf6ef0a2f74b731f384010e541", "patch": "@@ -196,7 +196,7 @@ def load(self, src, all_group):\n tokens = shlex.split(line)\n \n if input_mode == 'host':\n- new_host = MemHost(tokens[0], self.inventory_base)\n+ new_host = self.get_host(tokens[0])\n if len(tokens) > 1:\n variables = {}\n for t in tokens[1:]:" } ]
awx
54f6426c0c4634417d3955fe09827af276aa1f3a
0fa5ba606bc5731fb8b8d97223fe5921bc4639af
awx/main/management/commands/inventory_import.py
https://github.com/gconsidine/awx
true
false
true
@@ -547,7 +547,7 @@ class Command(BaseCommand): # for each host in a mem group, add it to the parents to which it belongs # FIXME: where it does not already exist for (k,v) in group_names.iteritems(): - LOGGER.info("adding parent arrangements for %s k") + LOGGER.info("adding parent arrangements for %s" % k) db_group = Group.objects.get(name=k, inventory__pk=inventory.pk) mem_hosts = v.hosts for h in mem_hosts:
LOGGER . info ( "adding parent arrangements for %s k" )
LOGGER . info ( "adding parent arrangements for %s" % k )
SINGLE_STMT
[["Insert", ["argument_list", 3, 24, 3, 63], ["binary_operator", "N0"], 1], ["Update", ["string:\"adding parent arrangements for %s k\"", 3, 25, 3, 62], "\"adding parent arrangements for %s\""], ["Move", "N0", ["string:\"adding parent arrangements for %s k\"", 3, 25, 3, 62], 0], ["Insert", "N0", ["%:%", "T"], 1], ["Insert", "N0", ["identifier:k", "T"], 2]]
gconsidine/awx@54f6426c0c4634417d3955fe09827af276aa1f3a
Cleanup debug message.
[ { "sha": "c9473312e0cde6432b0dc948afe9eec874371362", "filename": "awx/main/management/commands/inventory_import.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/54f6426c0c4634417d3955fe09827af276aa1f3a/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "raw_url": "https://github.com/gconsidine/awx/raw/54f6426c0c4634417d3955fe09827af276aa1f3a/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py?ref=54f6426c0c4634417d3955fe09827af276aa1f3a", "patch": "@@ -547,7 +547,7 @@ def main(self, args, options):\n # for each host in a mem group, add it to the parents to which it belongs\n # FIXME: where it does not already exist\n for (k,v) in group_names.iteritems():\n- LOGGER.info(\"adding parent arrangements for %s k\")\n+ LOGGER.info(\"adding parent arrangements for %s\" % k)\n db_group = Group.objects.get(name=k, inventory__pk=inventory.pk)\n mem_hosts = v.hosts\n for h in mem_hosts:" } ]
awx
f6b3be40f116931603806b7886ff1063fe20b3e5
c3639f96ebf703a1a6d1bbd0d3a52cf1fadf189f
awx/main/access.py
https://github.com/gconsidine/awx
true
false
true
@@ -758,7 +758,7 @@ class JobTemplateAccess(BaseAccess): # be able to proceed without additional checks. project_pk = get_pk_from_dict(data, 'project') project = get_object_or_400(Project, pk=project_pk) - if self.user.can_access(Project, 'admin', project): + if self.user.can_access(Project, 'admin', project, None): return True # Otherwise, check for explicitly granted permissions for the project
if self . user . can_access ( Project , 'admin' , project ) : return True
if self . user . can_access ( Project , 'admin' , project , None ) : return True
SAME_FUNCTION_MORE_ARGS
[["Insert", ["argument_list", 3, 32, 3, 59], [",:,", "T"], 6], ["Insert", ["argument_list", 3, 32, 3, 59], ["none:None", "T"], 7]]
gconsidine/awx@f6b3be40f116931603806b7886ff1063fe20b3e5
Fix for AC-265.
[ { "sha": "fe32f2be9085cf778b5516e4589f5f14ede2cc33", "filename": "awx/main/access.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/f6b3be40f116931603806b7886ff1063fe20b3e5/awx%2Fmain%2Faccess.py", "raw_url": "https://github.com/gconsidine/awx/raw/f6b3be40f116931603806b7886ff1063fe20b3e5/awx%2Fmain%2Faccess.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=f6b3be40f116931603806b7886ff1063fe20b3e5", "patch": "@@ -758,7 +758,7 @@ def can_add(self, data):\n # be able to proceed without additional checks.\n project_pk = get_pk_from_dict(data, 'project')\n project = get_object_or_400(Project, pk=project_pk)\n- if self.user.can_access(Project, 'admin', project):\n+ if self.user.can_access(Project, 'admin', project, None):\n return True\n \n # Otherwise, check for explicitly granted permissions for the project" } ]
awx
8ccf4c0a898c768195b76ff6128fc609b8987909
01d7df3ab2af5da6aec4ed2104e9161b45e23ba1
awx/settings/development.py
https://github.com/gconsidine/awx
true
false
false
@@ -18,6 +18,6 @@ try: sys.modules['local_settings'] = dummymodule(local_settings_file) except IOError, e: from django.core.exceptions import ImproperlyConfigured - if os.path.exists(settings_file): + if os.path.exists(local_settings_file): msg = 'Unable to load %s: %s' % (local_settings_file, str(e)) raise ImproperlyConfigured(msg)
if os . path . exists ( settings_file ) : msg = 'Unable to load %s: %s' % ( local_settings_file , str ( e ) ) raise ImproperlyConfigured ( msg )
if os . path . exists ( local_settings_file ) : msg = 'Unable to load %s: %s' % ( local_settings_file , str ( e ) ) raise ImproperlyConfigured ( msg )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:settings_file", 3, 23, 3, 36], "local_settings_file"]]
gconsidine/awx@8ccf4c0a898c768195b76ff6128fc609b8987909
Fix typo in development settings.
[ { "sha": "05ada87826e5796358a72811dd61d0d2737553d0", "filename": "awx/settings/development.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/8ccf4c0a898c768195b76ff6128fc609b8987909/awx%2Fsettings%2Fdevelopment.py", "raw_url": "https://github.com/gconsidine/awx/raw/8ccf4c0a898c768195b76ff6128fc609b8987909/awx%2Fsettings%2Fdevelopment.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fsettings%2Fdevelopment.py?ref=8ccf4c0a898c768195b76ff6128fc609b8987909", "patch": "@@ -18,6 +18,6 @@ class dummymodule(str):\n sys.modules['local_settings'] = dummymodule(local_settings_file)\n except IOError, e:\n from django.core.exceptions import ImproperlyConfigured\n- if os.path.exists(settings_file):\n+ if os.path.exists(local_settings_file):\n msg = 'Unable to load %s: %s' % (local_settings_file, str(e))\n raise ImproperlyConfigured(msg)" } ]
awx
e161efdd6720ae1f9c8f814acbefd0af76dafb4a
5d8ef49cfd11eba1e82a449b3b55758ed7cd8bb5
awx/main/management/commands/inventory_import.py
https://github.com/gconsidine/awx
true
false
true
@@ -338,7 +338,7 @@ class GenericLoader(object): for f in glob.glob("%s/*" % src): if f.endswith(".ini"): # config files for inventory scripts should be ignored - pass + continue if not os.path.isdir(f): if os.access(f, os.X_OK): ExecutableJsonLoader().load(f, memGroup)
pass
continue
SINGLE_TOKEN
[["Insert", ["block", 3, 21, 3, 25], ["continue_statement", "N0"], 0], ["Insert", "N0", ["continue:continue", "T"], 0], ["Delete", ["pass:pass", 3, 21, 3, 25]], ["Delete", ["pass_statement", 3, 21, 3, 25]]]
gconsidine/awx@e161efdd6720ae1f9c8f814acbefd0af76dafb4a
Fix .ini skipping logic in inventory importer
[ { "sha": "66dbb78ed8abcfcf8929570155c11413a96abd7e", "filename": "awx/main/management/commands/inventory_import.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/e161efdd6720ae1f9c8f814acbefd0af76dafb4a/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "raw_url": "https://github.com/gconsidine/awx/raw/e161efdd6720ae1f9c8f814acbefd0af76dafb4a/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py?ref=e161efdd6720ae1f9c8f814acbefd0af76dafb4a", "patch": "@@ -338,7 +338,7 @@ def __init__(self, src):\n for f in glob.glob(\"%s/*\" % src):\n if f.endswith(\".ini\"):\n # config files for inventory scripts should be ignored\n- pass\n+ continue \n if not os.path.isdir(f):\n if os.access(f, os.X_OK):\n ExecutableJsonLoader().load(f, memGroup)" } ]
awx
f78eb15e417ff3ba25c9f4cdc1c3c5c99182224c
e161efdd6720ae1f9c8f814acbefd0af76dafb4a
awx/main/management/commands/inventory_import.py
https://github.com/gconsidine/awx
true
false
true
@@ -253,7 +253,7 @@ class ExecutableJsonLoader(BaseLoader): proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = proc.communicate() if proc.returncode != 0: - raise ImportException("%s list failed %s with output: %s" % (src, stderr, proc.returncode)) + raise ImportException("%s list failed %s with output: %s" % (cmd, stderr, proc.returncode)) data = {} try: data = json.loads(stdout)
raise ImportException ( "%s list failed %s with output: %s" % ( src , stderr , proc . returncode ) )
raise ImportException ( "%s list failed %s with output: %s" % ( cmd , stderr , proc . returncode ) )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:src", 3, 74, 3, 77], "cmd"]]
gconsidine/awx@f78eb15e417ff3ba25c9f4cdc1c3c5c99182224c
fix typo in json import error handling
[ { "sha": "1301f577afaa28d210fbe6dd5a56cfa52ddcdb2d", "filename": "awx/main/management/commands/inventory_import.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/f78eb15e417ff3ba25c9f4cdc1c3c5c99182224c/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "raw_url": "https://github.com/gconsidine/awx/raw/f78eb15e417ff3ba25c9f4cdc1c3c5c99182224c/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py?ref=f78eb15e417ff3ba25c9f4cdc1c3c5c99182224c", "patch": "@@ -253,7 +253,7 @@ def command_to_json(self, cmd):\n proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n (stdout, stderr) = proc.communicate()\n if proc.returncode != 0:\n- raise ImportException(\"%s list failed %s with output: %s\" % (src, stderr, proc.returncode))\n+ raise ImportException(\"%s list failed %s with output: %s\" % (cmd, stderr, proc.returncode))\n data = {}\n try:\n data = json.loads(stdout)" } ]
awx
57235cad7a65cd84dcb65e314276a0cbc849e1b7
597a81ead65e7bd626c3f196daf88f3bceb49877
awx/__init__.py
https://github.com/gconsidine/awx
true
false
true
@@ -71,6 +71,6 @@ def manage(): # Now run the command (or display the version). from django.core.management import execute_from_command_line if len(sys.argv) >= 2 and sys.argv[1] in ('version', '--version'): - sys.stdout.write('awx-%s\n' % __version__) + sys.stdout.write('%s\n' % __version__) else: execute_from_command_line(sys.argv)
sys . stdout . write ( 'awx-%s\n' % __version__ )
sys . stdout . write ( '%s\n' % __version__ )
CHANGE_BINARY_OPERAND
[["Update", ["string:'awx-%s\\n'", 3, 26, 3, 36], "'%s\\n'"]]
gconsidine/awx@57235cad7a65cd84dcb65e314276a0cbc849e1b7
Remove 'awx-' prefix when reporting version
[ { "sha": "5633508baaae3889ddf7fbe20895fde6826d5fb9", "filename": "awx/__init__.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/57235cad7a65cd84dcb65e314276a0cbc849e1b7/awx%2F__init__.py", "raw_url": "https://github.com/gconsidine/awx/raw/57235cad7a65cd84dcb65e314276a0cbc849e1b7/awx%2F__init__.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2F__init__.py?ref=57235cad7a65cd84dcb65e314276a0cbc849e1b7", "patch": "@@ -71,6 +71,6 @@ def manage():\n # Now run the command (or display the version).\n from django.core.management import execute_from_command_line\n if len(sys.argv) >= 2 and sys.argv[1] in ('version', '--version'):\n- sys.stdout.write('awx-%s\\n' % __version__)\n+ sys.stdout.write('%s\\n' % __version__)\n else:\n execute_from_command_line(sys.argv)" } ]
awx
2e45ad1a639c79d59f8149dcbdf33fe581341586
48f81c5be7a43792c6b970b5515fa0ac839ff965
awx/__init__.py
https://github.com/gconsidine/awx
true
false
true
@@ -71,6 +71,6 @@ def manage(): # Now run the command (or display the version). from django.core.management import execute_from_command_line if len(sys.argv) >= 2 and sys.argv[1] in ('version', '--version'): - sys.stdout.write('awx-%s\n' % __version__) + sys.stdout.write('%s\n' % __version__) else: execute_from_command_line(sys.argv)
sys . stdout . write ( 'awx-%s\n' % __version__ )
sys . stdout . write ( '%s\n' % __version__ )
CHANGE_BINARY_OPERAND
[["Update", ["string:'awx-%s\\n'", 3, 26, 3, 36], "'%s\\n'"]]
gconsidine/awx@2e45ad1a639c79d59f8149dcbdf33fe581341586
Remove 'awx-' prefix when reporting version
[ { "sha": "5633508baaae3889ddf7fbe20895fde6826d5fb9", "filename": "awx/__init__.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/2e45ad1a639c79d59f8149dcbdf33fe581341586/awx%2F__init__.py", "raw_url": "https://github.com/gconsidine/awx/raw/2e45ad1a639c79d59f8149dcbdf33fe581341586/awx%2F__init__.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2F__init__.py?ref=2e45ad1a639c79d59f8149dcbdf33fe581341586", "patch": "@@ -71,6 +71,6 @@ def manage():\n # Now run the command (or display the version).\n from django.core.management import execute_from_command_line\n if len(sys.argv) >= 2 and sys.argv[1] in ('version', '--version'):\n- sys.stdout.write('awx-%s\\n' % __version__)\n+ sys.stdout.write('%s\\n' % __version__)\n else:\n execute_from_command_line(sys.argv)" } ]
awx
a1ec54920f6fb5f9afa6867f372cdb7433b354e4
8c9a98befc6be8e95801971aa8036d0de0d41bf8
awx/main/access.py
https://github.com/gconsidine/awx
true
false
true
@@ -359,7 +359,7 @@ class HostAccess(BaseAccess): # but still go down *most* of the license code path. validation_info['free_instances'] = 99999999 - if not validation_info.get('demo') and validation_info.get('time_remaining') < 0: + if not validation_info.get('demo') and validation_info.get('time_remaining') <= 0: raise PermissionDenied("license has expired") if validation_info.get('free_instances', 0) > 0:
if not validation_info . get ( 'demo' ) and validation_info . get ( 'time_remaining' ) < 0 : raise PermissionDenied ( "license has expired" )
if not validation_info . get ( 'demo' ) and validation_info . get ( 'time_remaining' ) <= 0 : raise PermissionDenied ( "license has expired" )
CHANGE_BINARY_OPERATOR
[["Insert", ["comparison_operator", 3, 48, 3, 89], ["<=:<=", "T"], 1], ["Delete", ["<:<", 3, 86, 3, 87]]]
gconsidine/awx@a1ec54920f6fb5f9afa6867f372cdb7433b354e4
Small fix to license expire time check
[ { "sha": "f799b7ada75f54c453caeafe995279f703588ea7", "filename": "awx/main/access.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/a1ec54920f6fb5f9afa6867f372cdb7433b354e4/awx%2Fmain%2Faccess.py", "raw_url": "https://github.com/gconsidine/awx/raw/a1ec54920f6fb5f9afa6867f372cdb7433b354e4/awx%2Fmain%2Faccess.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=a1ec54920f6fb5f9afa6867f372cdb7433b354e4", "patch": "@@ -359,7 +359,7 @@ def can_add(self, data):\n # but still go down *most* of the license code path.\n validation_info['free_instances'] = 99999999\n \n- if not validation_info.get('demo') and validation_info.get('time_remaining') < 0:\n+ if not validation_info.get('demo') and validation_info.get('time_remaining') <= 0:\n raise PermissionDenied(\"license has expired\")\n \n if validation_info.get('free_instances', 0) > 0:" } ]
awx
d176466cccb5ac611d1caf2dcaa92794e1cd3605
16d9af6945fd84bf6ec296e684f1fe454f0c1b37
awx/main/tasks.py
https://github.com/gconsidine/awx
true
false
true
@@ -325,7 +325,7 @@ class BaseTask(Task): if kwargs.get('private_data_file', ''): try: os.remove(kwargs['private_data_file']) - except IOError: + except OSError: pass try: stdout_handle.close()
try : os . remove ( kwargs [ 'private_data_file' ] ) except IOError : pass
try : os . remove ( kwargs [ 'private_data_file' ] ) except OSError : pass
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:IOError", 3, 24, 3, 31], "OSError"]]
gconsidine/awx@d176466cccb5ac611d1caf2dcaa92794e1cd3605
Fix a customer issue in HEAD. We should catch OSError here instead of IOError
[ { "sha": "7abf10af2832b3bf3009e3968fd154fa9320b88e", "filename": "awx/main/tasks.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/d176466cccb5ac611d1caf2dcaa92794e1cd3605/awx%2Fmain%2Ftasks.py", "raw_url": "https://github.com/gconsidine/awx/raw/d176466cccb5ac611d1caf2dcaa92794e1cd3605/awx%2Fmain%2Ftasks.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftasks.py?ref=d176466cccb5ac611d1caf2dcaa92794e1cd3605", "patch": "@@ -325,7 +325,7 @@ def run(self, pk, **kwargs):\n if kwargs.get('private_data_file', ''):\n try:\n os.remove(kwargs['private_data_file'])\n- except IOError:\n+ except OSError:\n pass\n try:\n stdout_handle.close()" } ]
awx
4b9059388e603e32f5448fd73e5e4a2d7920f92d
523caf846c09bbea35d39916760d64970acc59b8
awx/settings/defaults.py
https://github.com/gconsidine/awx
true
false
false
@@ -349,7 +349,7 @@ else: CALLBACK_CONSUMER_PORT = "tcp://127.0.0.1:5556" CALLBACK_QUEUE_PORT = "ipc:///tmp/callback_receiver.ipc" -TASK_COMMAND_PORT = "ipc:///tmp/task_command_receiver.ipc" +TASK_COMMAND_PORT = "tcp://127.0.0.1:6556" # Logging configuration. LOGGING = {
TASK_COMMAND_PORT = "ipc:///tmp/task_command_receiver.ipc"
TASK_COMMAND_PORT = "tcp://127.0.0.1:6556"
CHANGE_STRING_LITERAL
[["Update", ["string:\"ipc:///tmp/task_command_receiver.ipc\"", 3, 21, 3, 59], "\"tcp://127.0.0.1:6556\""]]
gconsidine/awx@4b9059388e603e32f5448fd73e5e4a2d7920f92d
Switch to using a network socket instead of an ipc socket, closes issue AC-1088
[ { "sha": "3a75da2f4851d94b83079b65b6cf96656c66e5d8", "filename": "awx/settings/defaults.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/4b9059388e603e32f5448fd73e5e4a2d7920f92d/awx%2Fsettings%2Fdefaults.py", "raw_url": "https://github.com/gconsidine/awx/raw/4b9059388e603e32f5448fd73e5e4a2d7920f92d/awx%2Fsettings%2Fdefaults.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fsettings%2Fdefaults.py?ref=4b9059388e603e32f5448fd73e5e4a2d7920f92d", "patch": "@@ -349,7 +349,7 @@\n CALLBACK_CONSUMER_PORT = \"tcp://127.0.0.1:5556\"\n CALLBACK_QUEUE_PORT = \"ipc:///tmp/callback_receiver.ipc\"\n \n-TASK_COMMAND_PORT = \"ipc:///tmp/task_command_receiver.ipc\"\n+TASK_COMMAND_PORT = \"tcp://127.0.0.1:6556\"\n \n # Logging configuration.\n LOGGING = {" } ]
awx
6e05e39c09355ff18138601ac4aef47ae2729abf
f73c352f0ddeb5ceb95c04d39e38b3ea9a0d0195
awx/main/models/unified_jobs.py
https://github.com/gconsidine/awx
true
false
true
@@ -391,7 +391,7 @@ class UnifiedJob(PolymorphicModel, CommonModelNameNotUnique): else: elapsed = 0.0 if self.elapsed != elapsed: - self.elapsed = elapsed + self.elapsed = str(elapsed) if 'elapsed' not in update_fields: update_fields.append('elapsed') if self.unified_job_template != self._get_parent_instance():
self . elapsed = elapsed
self . elapsed = str ( elapsed )
ADD_FUNCTION_AROUND_EXPRESSION
[["Insert", ["assignment", 3, 13, 3, 35], ["call", "N0"], 2], ["Insert", "N0", ["identifier:str", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["identifier:elapsed", 3, 28, 3, 35], 1], ["Insert", "N1", ["):)", "T"], 2]]
gconsidine/awx@6e05e39c09355ff18138601ac4aef47ae2729abf
AC-1040 Another Python2.6 fix.
[ { "sha": "a78603421e48e2c11e01f3c1b1855047af65dd36", "filename": "awx/main/models/unified_jobs.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/6e05e39c09355ff18138601ac4aef47ae2729abf/awx%2Fmain%2Fmodels%2Funified_jobs.py", "raw_url": "https://github.com/gconsidine/awx/raw/6e05e39c09355ff18138601ac4aef47ae2729abf/awx%2Fmain%2Fmodels%2Funified_jobs.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Funified_jobs.py?ref=6e05e39c09355ff18138601ac4aef47ae2729abf", "patch": "@@ -391,7 +391,7 @@ def save(self, *args, **kwargs):\n else:\n elapsed = 0.0\n if self.elapsed != elapsed:\n- self.elapsed = elapsed\n+ self.elapsed = str(elapsed)\n if 'elapsed' not in update_fields:\n update_fields.append('elapsed')\n if self.unified_job_template != self._get_parent_instance():" } ]
awx
62a74f9c844c2b76c3a24cc80c194f295220b7a2
6e05e39c09355ff18138601ac4aef47ae2729abf
awx/api/serializers.py
https://github.com/gconsidine/awx
true
false
true
@@ -368,7 +368,7 @@ class ProjectSerializer(BaseSerializer): # Backwards compatibility. if obj.current_update: res['current_update'] = reverse('api:project_update_detail', - args=(obj.last_update.pk,)) + args=(obj.current_update.pk,)) if obj.last_update: res['last_update'] = reverse('api:project_update_detail', args=(obj.last_update.pk,))
res [ 'current_update' ] = reverse ( 'api:project_update_detail' , args = ( obj . last_update . pk , ) )
res [ 'current_update' ] = reverse ( 'api:project_update_detail' , args = ( obj . current_update . pk , ) )
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:last_update", 3, 55, 3, 66], "current_update"]]
gconsidine/awx@62a74f9c844c2b76c3a24cc80c194f295220b7a2
AC-1096 Fixed typo for project current_update.
[ { "sha": "3a20effbe7629ad8467327eaba46ee1775649661", "filename": "awx/api/serializers.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/62a74f9c844c2b76c3a24cc80c194f295220b7a2/awx%2Fapi%2Fserializers.py", "raw_url": "https://github.com/gconsidine/awx/raw/62a74f9c844c2b76c3a24cc80c194f295220b7a2/awx%2Fapi%2Fserializers.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=62a74f9c844c2b76c3a24cc80c194f295220b7a2", "patch": "@@ -368,7 +368,7 @@ def get_related(self, obj):\n # Backwards compatibility.\n if obj.current_update:\n res['current_update'] = reverse('api:project_update_detail',\n- args=(obj.last_update.pk,))\n+ args=(obj.current_update.pk,))\n if obj.last_update:\n res['last_update'] = reverse('api:project_update_detail',\n args=(obj.last_update.pk,))" } ]
awx
ceba67fcf0f80afc2a19548ce1f536d2223570e5
21c81268385808d092d9d2268f6b6254412e7e94
awx/settings/defaults.py
https://github.com/gconsidine/awx
true
false
false
@@ -338,7 +338,7 @@ EC2_REGIONS_BLACKLIST = [ # Defaults for enabling/disabling activity stream. ACTIVITY_STREAM_ENABLED = True -ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC = True +ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC = False # Internal API URL for use by inventory scripts and callback plugin. if 'devserver' in INSTALLED_APPS:
ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC = True
ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC = False
CHANGE_BOOLEAN_LITERAL
[["Insert", ["assignment", 3, 1, 3, 50], ["false:False", "T"], 2], ["Delete", ["true:True", 3, 46, 3, 50]]]
gconsidine/awx@ceba67fcf0f80afc2a19548ce1f536d2223570e5
AC-982 Disable activity stream for inventory import by default.
[ { "sha": "b49a62ea6024ff38545df5a24131e9a7804b4356", "filename": "awx/settings/defaults.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/ceba67fcf0f80afc2a19548ce1f536d2223570e5/awx%2Fsettings%2Fdefaults.py", "raw_url": "https://github.com/gconsidine/awx/raw/ceba67fcf0f80afc2a19548ce1f536d2223570e5/awx%2Fsettings%2Fdefaults.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fsettings%2Fdefaults.py?ref=ceba67fcf0f80afc2a19548ce1f536d2223570e5", "patch": "@@ -338,7 +338,7 @@\n \n # Defaults for enabling/disabling activity stream.\n ACTIVITY_STREAM_ENABLED = True\n-ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC = True\n+ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC = False\n \n # Internal API URL for use by inventory scripts and callback plugin.\n if 'devserver' in INSTALLED_APPS:" } ]
neo-python
a833454f26bee7c8fdc1b90e8fc5235b3f4a6bc3
7dc936f92b821afebabcf4be3da9b7c98f31790f
neo/Core/State/ContractState.py
https://github.com/Ranchosm335/neo-python
true
false
true
@@ -39,7 +39,7 @@ class ContractState(StateBase): self.CodeVersion = reader.ReadVarString(max=252) self.Author = reader.ReadVarString(max=252) self.Email = reader.ReadVarString(max=252) - self.Description = reader.ReadVarString(max=252) + self.Description = reader.ReadVarString(max=65536) @staticmethod def DeserializeFromDB(buffer):
self . Description = reader . ReadVarString ( max = 252 )
self . Description = reader . ReadVarString ( max = 65536 )
CHANGE_NUMERIC_LITERAL
[["Update", ["integer:252", 3, 53, 3, 56], "65536"]]
Ranchosm335/neo-python@a833454f26bee7c8fdc1b90e8fc5235b3f4a6bc3
fix for segfault issue when deserializing contract state
[ { "sha": "453f332d65442f4b5e026a618849af4bc62dab15", "filename": "neo/Core/State/ContractState.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Ranchosm335/neo-python/blob/a833454f26bee7c8fdc1b90e8fc5235b3f4a6bc3/neo%2FCore%2FState%2FContractState.py", "raw_url": "https://github.com/Ranchosm335/neo-python/raw/a833454f26bee7c8fdc1b90e8fc5235b3f4a6bc3/neo%2FCore%2FState%2FContractState.py", "contents_url": "https://api.github.com/repos/Ranchosm335/neo-python/contents/neo%2FCore%2FState%2FContractState.py?ref=a833454f26bee7c8fdc1b90e8fc5235b3f4a6bc3", "patch": "@@ -39,7 +39,7 @@ def Deserialize(self, reader):\n self.CodeVersion = reader.ReadVarString(max=252)\n self.Author = reader.ReadVarString(max=252)\n self.Email = reader.ReadVarString(max=252)\n- self.Description = reader.ReadVarString(max=252)\n+ self.Description = reader.ReadVarString(max=65536)\n \n @staticmethod\n def DeserializeFromDB(buffer):" } ]
neo-python
925dc7186a5719e79d3c8fcb96600791604f8fa1
606103a849c68fb3b06eec60fb68b958e333c0d1
neo/Core/State/StorageKey.py
https://github.com/Ranchosm335/neo-python
true
false
true
@@ -14,7 +14,7 @@ class StorageKey(SerializableMixin): self.Key = key def _murmur(self): - return mmh3.hash(self.Key) + return mmh3.hash(bytes(self.Key)) def GetHashCode(self): return abs(self.ScriptHash.GetHashCode() + self._murmur())
return mmh3 . hash ( self . Key )
return mmh3 . hash ( bytes ( self . Key ) )
ADD_FUNCTION_AROUND_EXPRESSION
[["Insert", ["argument_list", 3, 25, 3, 35], ["(:(", "T"], 0], ["Insert", ["argument_list", 3, 25, 3, 35], ["call", "N0"], 1], ["Insert", ["argument_list", 3, 25, 3, 35], ["):)", "T"], 2], ["Insert", "N0", ["identifier:bytes", "T"], 0], ["Move", "N0", ["argument_list", 3, 25, 3, 35], 1]]
Ranchosm335/neo-python@925dc7186a5719e79d3c8fcb96600791604f8fa1
fix for readonly bytearray issue with murmur library
[ { "sha": "3d96052aa16dbd281278a124d6fff382458d8d1e", "filename": "neo/Core/State/StorageKey.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Ranchosm335/neo-python/blob/925dc7186a5719e79d3c8fcb96600791604f8fa1/neo%2FCore%2FState%2FStorageKey.py", "raw_url": "https://github.com/Ranchosm335/neo-python/raw/925dc7186a5719e79d3c8fcb96600791604f8fa1/neo%2FCore%2FState%2FStorageKey.py", "contents_url": "https://api.github.com/repos/Ranchosm335/neo-python/contents/neo%2FCore%2FState%2FStorageKey.py?ref=925dc7186a5719e79d3c8fcb96600791604f8fa1", "patch": "@@ -14,7 +14,7 @@ def __init__(self, script_hash=None, key=None):\n self.Key = key\n \n def _murmur(self):\n- return mmh3.hash(self.Key)\n+ return mmh3.hash(bytes(self.Key))\n \n def GetHashCode(self):\n return abs(self.ScriptHash.GetHashCode() + self._murmur())" } ]
neo-python
bb990b8108a44af0809c3fe73c5613379165e681
d59e64c319888c496b416d9fc7c6bda26cd231ea
neo/SmartContract/StateReader.py
https://github.com/Ranchosm335/neo-python
true
false
true
@@ -536,7 +536,7 @@ class StateReader(InteropService): output = engine.EvaluationStack.Pop().GetInterface('neo.Core.TX.Transaction.TransactionOutput') if output is None: return False - engine.EvaluationStack.PushT(output.AssetId) + engine.EvaluationStack.PushT(output.AssetId.ToArray()) return True def Output_GetValue(self, engine):
engine . EvaluationStack . PushT ( output . AssetId )
engine . EvaluationStack . PushT ( output . AssetId . ToArray ( ) )
ADD_METHOD_CALL
[["Insert", ["argument_list", 3, 37, 3, 53], ["call", "N0"], 1], ["Insert", ["argument_list", 3, 37, 3, 53], ["):)", "T"], 2], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["attribute", 3, 38, 3, 52], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:ToArray", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Move", "N2", ["):)", 3, 52, 3, 53], 1]]
Ranchosm335/neo-python@bb990b8108a44af0809c3fe73c5613379165e681
Fix implementation to push bytearray onto stack rather than UInt256
[ { "sha": "95148def84644f43018597bd57518670bc8a4aae", "filename": "neo/SmartContract/StateReader.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Ranchosm335/neo-python/blob/bb990b8108a44af0809c3fe73c5613379165e681/neo%2FSmartContract%2FStateReader.py", "raw_url": "https://github.com/Ranchosm335/neo-python/raw/bb990b8108a44af0809c3fe73c5613379165e681/neo%2FSmartContract%2FStateReader.py", "contents_url": "https://api.github.com/repos/Ranchosm335/neo-python/contents/neo%2FSmartContract%2FStateReader.py?ref=bb990b8108a44af0809c3fe73c5613379165e681", "patch": "@@ -536,7 +536,7 @@ def Output_GetAssetId(self, engine):\n output = engine.EvaluationStack.Pop().GetInterface('neo.Core.TX.Transaction.TransactionOutput')\n if output is None:\n return False\n- engine.EvaluationStack.PushT(output.AssetId)\n+ engine.EvaluationStack.PushT(output.AssetId.ToArray())\n return True\n \n def Output_GetValue(self, engine):" } ]
neo-python
7a98b47fade7a94c12627821f8b82d22f118a8e3
6171a6f2c9ce990c2859b469f2fb9da16116b357
neo/Prompt/Commands/Invoke.py
https://github.com/Ranchosm335/neo-python
true
false
true
@@ -128,7 +128,7 @@ def TestInvokeContract(wallet, args): output = TransactionOutput(AssetId=Blockchain.SystemCoin().Hash, Value=gas_to_attach, - script_hash=contract.Code.ScriptHash) + script_hash=contract.Code.ScriptHash()) outputs.append(output)
output = TransactionOutput ( AssetId = Blockchain . SystemCoin ( ) . Hash , Value = gas_to_attach , script_hash = contract . Code . ScriptHash )
output = TransactionOutput ( AssetId = Blockchain . SystemCoin ( ) . Hash , Value = gas_to_attach , script_hash = contract . Code . ScriptHash ( ) )
SINGLE_STMT
[["Insert", ["keyword_argument", 3, 39, 3, 75], ["call", "N0"], 2], ["Move", "N0", ["attribute", 3, 51, 3, 75], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["):)", "T"], 1]]
Ranchosm335/neo-python@7a98b47fade7a94c12627821f8b82d22f118a8e3
fix for issue with attaching gas
[ { "sha": "63d5c251d5c09e82e0a24d6e03242f10557b5726", "filename": "neo/Prompt/Commands/Invoke.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Ranchosm335/neo-python/blob/7a98b47fade7a94c12627821f8b82d22f118a8e3/neo%2FPrompt%2FCommands%2FInvoke.py", "raw_url": "https://github.com/Ranchosm335/neo-python/raw/7a98b47fade7a94c12627821f8b82d22f118a8e3/neo%2FPrompt%2FCommands%2FInvoke.py", "contents_url": "https://api.github.com/repos/Ranchosm335/neo-python/contents/neo%2FPrompt%2FCommands%2FInvoke.py?ref=7a98b47fade7a94c12627821f8b82d22f118a8e3", "patch": "@@ -128,7 +128,7 @@ def TestInvokeContract(wallet, args):\n \n output = TransactionOutput(AssetId=Blockchain.SystemCoin().Hash,\n Value=gas_to_attach,\n- script_hash=contract.Code.ScriptHash)\n+ script_hash=contract.Code.ScriptHash())\n \n outputs.append(output)\n " } ]
neo-python
a1d185a8494a36c584957d497667b0ce2756862c
9acffc7d501e342a83fdfa2f20cca60714662fc0
neo/VM/ExecutionEngine.py
https://github.com/Ranchosm335/neo-python
true
false
true
@@ -328,7 +328,7 @@ class ExecutionEngine(): return x = estack.Pop().GetByteArray() - estack.PushT( x[index:count]) + estack.PushT( x[index:count+index]) elif opcode == LEFT:
estack . PushT ( x [ index : count ] )
estack . PushT ( x [ index : count + index ] )
SINGLE_STMT
[["Insert", ["slice", 3, 33, 3, 44], ["binary_operator", "N0"], 2], ["Move", "N0", ["identifier:count", 3, 39, 3, 44], 0], ["Insert", "N0", ["+:+", "T"], 1], ["Insert", "N0", ["identifier:index", "T"], 2]]
Ranchosm335/neo-python@a1d185a8494a36c584957d497667b0ce2756862c
fix for bytearray slice end calculation for SUBSTR opcode
[ { "sha": "82d5301b5ac8a6875092e5d6f2da8a2655616345", "filename": "neo/VM/ExecutionEngine.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Ranchosm335/neo-python/blob/a1d185a8494a36c584957d497667b0ce2756862c/neo%2FVM%2FExecutionEngine.py", "raw_url": "https://github.com/Ranchosm335/neo-python/raw/a1d185a8494a36c584957d497667b0ce2756862c/neo%2FVM%2FExecutionEngine.py", "contents_url": "https://api.github.com/repos/Ranchosm335/neo-python/contents/neo%2FVM%2FExecutionEngine.py?ref=a1d185a8494a36c584957d497667b0ce2756862c", "patch": "@@ -328,7 +328,7 @@ def ExecuteOp(self, opcode, context):\n return\n \n x = estack.Pop().GetByteArray()\n- estack.PushT( x[index:count])\n+ estack.PushT( x[index:count+index])\n \n elif opcode == LEFT:\n " } ]
neo-python
cc6238fd6e640a563afa25483ea4ce4c7f93f3d9
08a2c7c0867d481c2d9075dcb7a1de815933f534
neo/SmartContract/ContractParameterType.py
https://github.com/Ranchosm335/neo-python
true
false
false
@@ -16,7 +16,7 @@ class ContractParameterType(object): ByteArray = 0x05 # 字节数组 PublicKey = 0x06 String = 0x07 - Array = 0xf0 + Array = 0x10 Void = 0xff
Array = 0xf0
Array = 0x10
CHANGE_NUMERIC_LITERAL
[["Update", ["integer:0xf0", 3, 13, 3, 17], "0x10"]]
Ranchosm335/neo-python@cc6238fd6e640a563afa25483ea4ce4c7f93f3d9
fix Array contract parameter type
[ { "sha": "1d6e3adb9674b9a7f01e8cd7e6c334eadf0a8b20", "filename": "neo/SmartContract/ContractParameterType.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Ranchosm335/neo-python/blob/cc6238fd6e640a563afa25483ea4ce4c7f93f3d9/neo%2FSmartContract%2FContractParameterType.py", "raw_url": "https://github.com/Ranchosm335/neo-python/raw/cc6238fd6e640a563afa25483ea4ce4c7f93f3d9/neo%2FSmartContract%2FContractParameterType.py", "contents_url": "https://api.github.com/repos/Ranchosm335/neo-python/contents/neo%2FSmartContract%2FContractParameterType.py?ref=cc6238fd6e640a563afa25483ea4ce4c7f93f3d9", "patch": "@@ -16,7 +16,7 @@ class ContractParameterType(object):\n ByteArray = 0x05 # 字节数组\n PublicKey = 0x06\n String = 0x07\n- Array = 0xf0\n+ Array = 0x10\n Void = 0xff\n \n " } ]
neo-python
b2470bcb37fecfb5366e4ef8900c20b9de0bd3c3
263b261219df81268b130640b774fa916cc4e92a
neo/SmartContract/StateReader.py
https://github.com/Ranchosm335/neo-python
true
false
true
@@ -710,7 +710,7 @@ class StateReader(InteropService): valStr = bytearray(0) - if item.Value is not None: + if item is not None: valStr = bytearray(item.Value) if len(key) == 20:
if item . Value is not None : valStr = bytearray ( item . Value )
if item is not None : valStr = bytearray ( item . Value )
SINGLE_STMT
[["Move", ["comparison_operator", 3, 12, 3, 34], ["identifier:item", 3, 12, 3, 16], 0], ["Delete", [".:.", 3, 16, 3, 17]], ["Delete", ["identifier:Value", 3, 17, 3, 22]], ["Delete", ["attribute", 3, 12, 3, 22]]]
Ranchosm335/neo-python@b2470bcb37fecfb5366e4ef8900c20b9de0bd3c3
fix for storage.get issue
[ { "sha": "8e78a037e785e54937a18b5e74570706f9aca183", "filename": "neo/SmartContract/StateReader.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Ranchosm335/neo-python/blob/b2470bcb37fecfb5366e4ef8900c20b9de0bd3c3/neo%2FSmartContract%2FStateReader.py", "raw_url": "https://github.com/Ranchosm335/neo-python/raw/b2470bcb37fecfb5366e4ef8900c20b9de0bd3c3/neo%2FSmartContract%2FStateReader.py", "contents_url": "https://api.github.com/repos/Ranchosm335/neo-python/contents/neo%2FSmartContract%2FStateReader.py?ref=b2470bcb37fecfb5366e4ef8900c20b9de0bd3c3", "patch": "@@ -710,7 +710,7 @@ def Storage_Get(self, engine):\n \n valStr = bytearray(0)\n \n- if item.Value is not None:\n+ if item is not None:\n valStr = bytearray(item.Value)\n \n if len(key) == 20:" } ]
neo-python
a25e1178d543371aaaf887b1f9bfb18f32917c5b
6b9f94ce0156bf3e7f0b53c45c6a305bff5f0ae5
neo/SmartContract/ApplicationEngine.py
https://github.com/Ranchosm335/neo-python
true
false
true
@@ -167,7 +167,7 @@ class ApplicationEngine(ExecutionEngine): fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1] self.__log.debug(exc_type, fname, exc_tb.tb_lineno) self.__log.debug("exception calculating gas consumed %s " % e) - print("Exception calculating gas consumbed %s " % e) + print("Exception calculating gas consumed %s " % e) return False if not self.testMode and self.gas_consumed > self.gas_amount:
print ( "Exception calculating gas consumbed %s " % e )
print ( "Exception calculating gas consumed %s " % e )
CHANGE_BINARY_OPERAND
[["Update", ["string:\"Exception calculating gas consumbed %s \"", 3, 23, 3, 64], "\"Exception calculating gas consumed %s \""]]
Ranchosm335/neo-python@a25e1178d543371aaaf887b1f9bfb18f32917c5b
Spelling mistake in error message
[ { "sha": "a450a8d36839b158353843d454722322025c559a", "filename": "neo/SmartContract/ApplicationEngine.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Ranchosm335/neo-python/blob/a25e1178d543371aaaf887b1f9bfb18f32917c5b/neo%2FSmartContract%2FApplicationEngine.py", "raw_url": "https://github.com/Ranchosm335/neo-python/raw/a25e1178d543371aaaf887b1f9bfb18f32917c5b/neo%2FSmartContract%2FApplicationEngine.py", "contents_url": "https://api.github.com/repos/Ranchosm335/neo-python/contents/neo%2FSmartContract%2FApplicationEngine.py?ref=a25e1178d543371aaaf887b1f9bfb18f32917c5b", "patch": "@@ -167,7 +167,7 @@ def Execute(self):\n fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]\n self.__log.debug(exc_type, fname, exc_tb.tb_lineno)\n self.__log.debug(\"exception calculating gas consumed %s \" % e)\n- print(\"Exception calculating gas consumbed %s \" % e)\n+ print(\"Exception calculating gas consumed %s \" % e)\n return False\n \n if not self.testMode and self.gas_consumed > self.gas_amount:" } ]
awx
8f70884c2aac490577f27203e4b554c7165247eb
2ddac6cb642ec952e97be79984536594e21f6bba
awx/main/access.py
https://github.com/gconsidine/awx
true
false
true
@@ -348,7 +348,7 @@ class InventoryAccess(BaseAccess): return self.can_admin(obj, None) def can_run_ad_hoc_commands(self, obj): - return self.user in adhoc_role + return self.user in obj.adhoc_role class HostAccess(BaseAccess):
return self . user in adhoc_role
return self . user in obj . adhoc_role
SINGLE_STMT
[["Insert", ["comparison_operator", 3, 16, 3, 39], ["attribute", "N0"], 2], ["Insert", "N0", ["identifier:obj", "T"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Move", "N0", ["identifier:adhoc_role", 3, 29, 3, 39], 2]]
gconsidine/awx@8f70884c2aac490577f27203e4b554c7165247eb
role check fix
[ { "sha": "f5bb2a52e3bda2f1cfdc7f2370b9258b7c4e65a7", "filename": "awx/main/access.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/8f70884c2aac490577f27203e4b554c7165247eb/awx%2Fmain%2Faccess.py", "raw_url": "https://github.com/gconsidine/awx/raw/8f70884c2aac490577f27203e4b554c7165247eb/awx%2Fmain%2Faccess.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=8f70884c2aac490577f27203e4b554c7165247eb", "patch": "@@ -348,7 +348,7 @@ def can_delete(self, obj):\n return self.can_admin(obj, None)\n \n def can_run_ad_hoc_commands(self, obj):\n- return self.user in adhoc_role\n+ return self.user in obj.adhoc_role\n \n class HostAccess(BaseAccess):\n '''" } ]
awx
c3923da37aae2ea913c5af34eca76fb8a159d000
6229e978e9ef4a9a6873aaecd5371c859b22c13b
awx/main/access.py
https://github.com/gconsidine/awx
true
false
true
@@ -558,7 +558,7 @@ class CredentialAccess(BaseAccess): def can_change(self, obj, data): if self.user.is_superuser: return True - return self.user in obj.admin_role + return self.user in obj.owner_role def can_delete(self, obj): # Unassociated credentials may be marked deleted by anyone, though we
return self . user in obj . admin_role
return self . user in obj . owner_role
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:admin_role", 3, 33, 3, 43], "owner_role"]]
gconsidine/awx@c3923da37aae2ea913c5af34eca76fb8a159d000
fixing credential access
[ { "sha": "32e600fbe976f6d6892b5377e2b8cd8d963bb3ab", "filename": "awx/main/access.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/c3923da37aae2ea913c5af34eca76fb8a159d000/awx%2Fmain%2Faccess.py", "raw_url": "https://github.com/gconsidine/awx/raw/c3923da37aae2ea913c5af34eca76fb8a159d000/awx%2Fmain%2Faccess.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=c3923da37aae2ea913c5af34eca76fb8a159d000", "patch": "@@ -558,7 +558,7 @@ def can_use(self, obj):\n def can_change(self, obj, data):\n if self.user.is_superuser:\n return True\n- return self.user in obj.admin_role\n+ return self.user in obj.owner_role\n \n def can_delete(self, obj):\n # Unassociated credentials may be marked deleted by anyone, though we" } ]
awx
c440aefd8544475eb4d1d3a13cd2f6ca990f6af0
926d58b8b79a4fdc198226a4d315b2caebe4a04c
awx/main/migrations/_rbac.py
https://github.com/gconsidine/awx
true
false
true
@@ -390,7 +390,7 @@ def migrate_job_templates(apps, schema_editor): jt.execute_role.members.add(user) logger.info(smart_text(u'adding User({}) access to JobTemplate({})'.format(user.username, jt.name))) - if jt.accessible_by(user, {'execute': True}): + if user in jt.execute_role: # If the job template is already accessible by the user, because they # are a sytem, organization, or project admin, then don't add an explicit # role entry for them
if jt . accessible_by ( user , { 'execute' : True } ) :
if user in jt . execute_role :
SINGLE_STMT
[["Insert", ["if_statement", 3, 13, 3, 58], ["comparison_operator", "N0"], 1], ["Move", ["if_statement", 3, 13, 3, 58], [":::", 3, 49, 3, 50], 2], ["Move", "N0", ["identifier:user", 3, 33, 3, 37], 0], ["Insert", "N0", ["in:in", "T"], 1], ["Move", "N0", ["attribute", 3, 16, 3, 32], 2], ["Update", ["identifier:accessible_by", 3, 19, 3, 32], "execute_role"], ["Delete", ["(:(", 3, 32, 3, 33]], ["Delete", [",:,", 3, 37, 3, 38]], ["Delete", ["{:{", 3, 39, 3, 40]], ["Delete", ["string:'execute'", 3, 40, 3, 49]], ["Delete", ["true:True", 3, 51, 3, 55]], ["Delete", ["pair", 3, 40, 3, 55]], ["Delete", ["}:}", 3, 55, 3, 56]], ["Delete", ["dictionary", 3, 39, 3, 56]], ["Delete", ["):)", 3, 56, 3, 57]], ["Delete", ["argument_list", 3, 32, 3, 57]], ["Delete", ["call", 3, 16, 3, 57]], ["Delete", [":::", 3, 57, 3, 58]]]
gconsidine/awx@c440aefd8544475eb4d1d3a13cd2f6ca990f6af0
fix jt tests
[ { "sha": "0d7aa3ecb7f515ed6003d243bad0bbfb7375cd05", "filename": "awx/main/migrations/_rbac.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/c440aefd8544475eb4d1d3a13cd2f6ca990f6af0/awx%2Fmain%2Fmigrations%2F_rbac.py", "raw_url": "https://github.com/gconsidine/awx/raw/c440aefd8544475eb4d1d3a13cd2f6ca990f6af0/awx%2Fmain%2Fmigrations%2F_rbac.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmigrations%2F_rbac.py?ref=c440aefd8544475eb4d1d3a13cd2f6ca990f6af0", "patch": "@@ -390,7 +390,7 @@ def migrate_job_templates(apps, schema_editor):\n jt.execute_role.members.add(user)\n logger.info(smart_text(u'adding User({}) access to JobTemplate({})'.format(user.username, jt.name)))\n \n- if jt.accessible_by(user, {'execute': True}):\n+ if user in jt.execute_role:\n # If the job template is already accessible by the user, because they\n # are a sytem, organization, or project admin, then don't add an explicit\n # role entry for them" } ]
awx
527be453a468a34e0f6242c53d2c4e604c6e33a3
c440aefd8544475eb4d1d3a13cd2f6ca990f6af0
awx/main/tests/functional/test_rbac_credential.py
https://github.com/gconsidine/awx
true
false
true
@@ -22,7 +22,7 @@ def test_credential_migration_user(credential, user, permissions): def test_credential_use_role(credential, user, permissions): u = user('user', False) credential.use_role.members.add(u) - assert u in credential.owner_role + assert u in credential.use_role @pytest.mark.django_db def test_credential_migration_team_member(credential, team, user, permissions):
assert u in credential . owner_role
assert u in credential . use_role
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:owner_role", 3, 28, 3, 38], "use_role"]]
gconsidine/awx@527be453a468a34e0f6242c53d2c4e604c6e33a3
fix last cred test
[ { "sha": "e48b964bc854ee6891d410dc419d3a3a75b7d60d", "filename": "awx/main/tests/functional/test_rbac_credential.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/527be453a468a34e0f6242c53d2c4e604c6e33a3/awx%2Fmain%2Ftests%2Ffunctional%2Ftest_rbac_credential.py", "raw_url": "https://github.com/gconsidine/awx/raw/527be453a468a34e0f6242c53d2c4e604c6e33a3/awx%2Fmain%2Ftests%2Ffunctional%2Ftest_rbac_credential.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Ffunctional%2Ftest_rbac_credential.py?ref=527be453a468a34e0f6242c53d2c4e604c6e33a3", "patch": "@@ -22,7 +22,7 @@ def test_credential_migration_user(credential, user, permissions):\n def test_credential_use_role(credential, user, permissions):\n u = user('user', False)\n credential.use_role.members.add(u)\n- assert u in credential.owner_role\n+ assert u in credential.use_role\n \n @pytest.mark.django_db\n def test_credential_migration_team_member(credential, team, user, permissions):" } ]
awx
c18aa44cede94fe58adc101a7b68fea239294d8e
44a8da83c2d6cfab805a05b6a0871fb419b1a3a2
awx/api/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -3573,7 +3573,7 @@ class RoleChildrenList(SubListAPIView): # XXX: This should be the intersection between the roles of the user # and the roles that the requesting user has access to see role = Role.objects.get(pk=self.kwargs['pk']) - return role.children + return role.children.all()
return role . children
return role . children . all ( )
ADD_METHOD_CALL
[["Insert", ["return_statement", 3, 9, 3, 29], ["call", "N0"], 1], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["attribute", 3, 16, 3, 29], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:all", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["):)", "T"], 1]]
gconsidine/awx@c18aa44cede94fe58adc101a7b68fea239294d8e
Return Queryset instead of Manager fix
[ { "sha": "3e70cb80994414d526f39aef22f889e40f0d390b", "filename": "awx/api/views.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/c18aa44cede94fe58adc101a7b68fea239294d8e/awx%2Fapi%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/c18aa44cede94fe58adc101a7b68fea239294d8e/awx%2Fapi%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=c18aa44cede94fe58adc101a7b68fea239294d8e", "patch": "@@ -3573,7 +3573,7 @@ def get_queryset(self):\n # XXX: This should be the intersection between the roles of the user\n # and the roles that the requesting user has access to see\n role = Role.objects.get(pk=self.kwargs['pk'])\n- return role.children\n+ return role.children.all()\n \n \n " } ]
awx
9921d90316f08d040dbba3cdec961c45daecab99
48f61b43e743909e81fb4d49e423fb8cc4ba6191
awx/main/models/rbac.py
https://github.com/gconsidine/awx
true
false
true
@@ -437,5 +437,5 @@ def get_roles_on_resource(resource, accessor): ancestor__in=roles, content_type_id=ContentType.objects.get_for_model(resource).id, object_id=resource.id - ).values_list('role_field', flat=True) + ).values_list('role_field', flat=True).distinct() ]
values_list ( 'role_field' , flat = True )
values_list ( 'role_field' , flat = True ) . distinct ( )
ADD_METHOD_CALL
[["Insert", ["call", 3, 11, 3, 47], ["attribute", "N0"], 0], ["Insert", ["call", 3, 11, 3, 47], ["argument_list", "N1"], 1], ["Move", "N0", ["call", 3, 11, 3, 47], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:distinct", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["):)", "T"], 1]]
gconsidine/awx@9921d90316f08d040dbba3cdec961c45daecab99
Fixed duplicate active_roles entries #1692
[ { "sha": "3dd88d5227aa898c5ac0681f3fbaeaafb3f76d64", "filename": "awx/main/models/rbac.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/9921d90316f08d040dbba3cdec961c45daecab99/awx%2Fmain%2Fmodels%2Frbac.py", "raw_url": "https://github.com/gconsidine/awx/raw/9921d90316f08d040dbba3cdec961c45daecab99/awx%2Fmain%2Fmodels%2Frbac.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Frbac.py?ref=9921d90316f08d040dbba3cdec961c45daecab99", "patch": "@@ -437,5 +437,5 @@ def get_roles_on_resource(resource, accessor):\n ancestor__in=roles,\n content_type_id=ContentType.objects.get_for_model(resource).id,\n object_id=resource.id\n- ).values_list('role_field', flat=True)\n+ ).values_list('role_field', flat=True).distinct()\n ]" } ]
awx
2b589228d323f7c8199cfdaf20c81475d64e4c50
077db7931fc1682ba72ded6a2b23c72326bf6b81
awx/api/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -1225,7 +1225,7 @@ class CredentialList(ListCreateAPIView): organization = Organization.objects.get(pk=request.data['organization']) obj = organization - if self.request.user not in obj.admin_role: + if not self.request.user.can_access(type(obj), 'admin', obj, request.data): raise PermissionDenied() ret = super(CredentialList, self).post(request, *args, **kwargs)
if self . request . user not in obj . admin_role : raise PermissionDenied ( )
if not self . request . user . can_access ( type ( obj ) , 'admin' , obj , request . data ) : raise PermissionDenied ( )
SINGLE_STMT
[["Insert", ["if_statement", 3, 9, 4, 37], ["not_operator", "N0"], 1], ["Insert", "N0", ["not:not", "T"], 0], ["Insert", "N0", ["call", "N1"], 1], ["Insert", "N1", ["attribute", "N2"], 0], ["Insert", "N1", ["argument_list", "N3"], 1], ["Move", "N2", ["attribute", 3, 12, 3, 29], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:can_access", "T"], 2], ["Insert", "N3", ["(:(", "T"], 0], ["Insert", "N3", ["call", "N4"], 1], ["Insert", "N3", [",:,", "T"], 2], ["Insert", "N3", ["string:'admin'", "T"], 3], ["Insert", "N3", [",:,", "T"], 4], ["Insert", "N3", ["identifier:obj", "T"], 5], ["Insert", "N3", [",:,", "T"], 6], ["Move", "N3", ["attribute", 3, 37, 3, 51], 7], ["Insert", "N3", ["):)", "T"], 8], ["Insert", "N4", ["identifier:type", "T"], 0], ["Insert", "N4", ["argument_list", "N5"], 1], ["Update", ["identifier:obj", 3, 37, 3, 40], "request"], ["Update", ["identifier:admin_role", 3, 41, 3, 51], "data"], ["Insert", "N5", ["(:(", "T"], 0], ["Insert", "N5", ["identifier:obj", "T"], 1], ["Insert", "N5", ["):)", "T"], 2], ["Delete", ["not:not", 3, 30, 3, 33]], ["Delete", ["in:in", 3, 34, 3, 36]], ["Delete", ["comparison_operator", 3, 12, 3, 51]]]
gconsidine/awx@2b589228d323f7c8199cfdaf20c81475d64e4c50
Fixing CredentialList post access check
[ { "sha": "a9cca93d1d9e34c88a8014b258a10fd708918312", "filename": "awx/api/views.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/2b589228d323f7c8199cfdaf20c81475d64e4c50/awx%2Fapi%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/2b589228d323f7c8199cfdaf20c81475d64e4c50/awx%2Fapi%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=2b589228d323f7c8199cfdaf20c81475d64e4c50", "patch": "@@ -1225,7 +1225,7 @@ def post(self, request, *args, **kwargs):\n organization = Organization.objects.get(pk=request.data['organization'])\n obj = organization\n \n- if self.request.user not in obj.admin_role:\n+ if not self.request.user.can_access(type(obj), 'admin', obj, request.data):\n raise PermissionDenied()\n \n ret = super(CredentialList, self).post(request, *args, **kwargs)" } ]
awx
78148da55c2bb2b5a908f4c429f73f558be6b435
526e04a00ce3a245f25b5cfc177437d0cc1d0e71
awx/main/models/ad_hoc_commands.py
https://github.com/gconsidine/awx
true
false
true
@@ -88,7 +88,7 @@ class AdHocCommand(UnifiedJob): def clean_inventory(self): inv = self.inventory if not inv: - raise ValidationError('Inventory is no longer available.') + raise ValidationError('No valid inventory.') return inv def clean_credential(self):
raise ValidationError ( 'Inventory is no longer available.' )
raise ValidationError ( 'No valid inventory.' )
CHANGE_STRING_LITERAL
[["Update", ["string:'Inventory is no longer available.'", 3, 35, 3, 70], "'No valid inventory.'"]]
gconsidine/awx@78148da55c2bb2b5a908f4c429f73f558be6b435
change inventory error warning
[ { "sha": "6efac2ec630b765a342df79d827760d443075793", "filename": "awx/main/models/ad_hoc_commands.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/78148da55c2bb2b5a908f4c429f73f558be6b435/awx%2Fmain%2Fmodels%2Fad_hoc_commands.py", "raw_url": "https://github.com/gconsidine/awx/raw/78148da55c2bb2b5a908f4c429f73f558be6b435/awx%2Fmain%2Fmodels%2Fad_hoc_commands.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Fad_hoc_commands.py?ref=78148da55c2bb2b5a908f4c429f73f558be6b435", "patch": "@@ -88,7 +88,7 @@ class Meta(object):\n def clean_inventory(self):\n inv = self.inventory\n if not inv:\n- raise ValidationError('Inventory is no longer available.')\n+ raise ValidationError('No valid inventory.')\n return inv\n \n def clean_credential(self):" } ]
awx
47561978d27ff2acc3e5cd2247fd49c402468bde
4e32e905d943bbfdec4a75aefd1b7a9d33e85b81
awx/api/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -1498,7 +1498,7 @@ class HostAllGroupsList(SubListAPIView): def get_queryset(self): parent = self.get_parent_object() self.check_parent_access(parent) - qs = self.request.user.get_queryset(self.model) + qs = self.request.user.get_queryset(self.model).distinct() sublist_qs = parent.all_groups.distinct() return qs & sublist_qs
qs = self . request . user . get_queryset ( self . model )
qs = self . request . user . get_queryset ( self . model ) . distinct ( )
ADD_METHOD_CALL
[["Insert", ["call", 3, 14, 3, 56], ["attribute", "N0"], 0], ["Insert", ["call", 3, 14, 3, 56], ["argument_list", "N1"], 1], ["Move", "N0", ["call", 3, 14, 3, 56], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:distinct", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["):)", "T"], 1]]
gconsidine/awx@47561978d27ff2acc3e5cd2247fd49c402468bde
fixing non-unique query combining
[ { "sha": "1260bb67b4ad795e427f894b7100aa3182d5addf", "filename": "awx/api/views.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/47561978d27ff2acc3e5cd2247fd49c402468bde/awx%2Fapi%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/47561978d27ff2acc3e5cd2247fd49c402468bde/awx%2Fapi%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=47561978d27ff2acc3e5cd2247fd49c402468bde", "patch": "@@ -1498,7 +1498,7 @@ class HostAllGroupsList(SubListAPIView):\n def get_queryset(self):\n parent = self.get_parent_object()\n self.check_parent_access(parent)\n- qs = self.request.user.get_queryset(self.model)\n+ qs = self.request.user.get_queryset(self.model).distinct()\n sublist_qs = parent.all_groups.distinct()\n return qs & sublist_qs\n " } ]
awx
b18dd8fe21221c725096669493b27600e0ff382d
ce14c0daffc503603c3526eb4ac696a418e8a59d
awx/main/tasks.py
https://github.com/gconsidine/awx
true
false
false
@@ -558,7 +558,7 @@ class BaseTask(Task): instance = self.update_model(instance.pk) if instance.cancel_flag: try: - if tower_settings.AWX_PROOT_ENABLED: + if tower_settings.AWX_PROOT_ENABLED and self.should_use_proot(instance): # NOTE: Refactor this once we get a newer psutil across the board if not psutil: os.kill(child.pid, signal.SIGKILL)
if tower_settings . AWX_PROOT_ENABLED : if not psutil : os . kill ( child . pid , signal . SIGKILL )
if tower_settings . AWX_PROOT_ENABLED and self . should_use_proot ( instance ) : if not psutil : os . kill ( child . pid , signal . SIGKILL )
MORE_SPECIFIC_IF
[["Insert", ["if_statement", 3, 21, 6, 63], ["boolean_operator", "N0"], 1], ["Move", "N0", ["attribute", 3, 24, 3, 56], 0], ["Insert", "N0", ["and:and", "T"], 1], ["Insert", "N0", ["call", "N1"], 2], ["Insert", "N1", ["attribute", "N2"], 0], ["Insert", "N1", ["argument_list", "N3"], 1], ["Insert", "N2", ["identifier:self", "T"], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:should_use_proot", "T"], 2], ["Insert", "N3", ["(:(", "T"], 0], ["Insert", "N3", ["identifier:instance", "T"], 1], ["Insert", "N3", ["):)", "T"], 2]]
gconsidine/awx@b18dd8fe21221c725096669493b27600e0ff382d
fixes hanging chads, if chads were ansible
[ { "sha": "662ea913438ea2c9adbbc8d65e6ddb82fd1b19c2", "filename": "awx/main/tasks.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/b18dd8fe21221c725096669493b27600e0ff382d/awx%2Fmain%2Ftasks.py", "raw_url": "https://github.com/gconsidine/awx/raw/b18dd8fe21221c725096669493b27600e0ff382d/awx%2Fmain%2Ftasks.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftasks.py?ref=b18dd8fe21221c725096669493b27600e0ff382d", "patch": "@@ -558,7 +558,7 @@ def run_pexpect(self, instance, args, cwd, env, passwords, stdout_handle,\n instance = self.update_model(instance.pk)\n if instance.cancel_flag:\n try:\n- if tower_settings.AWX_PROOT_ENABLED:\n+ if tower_settings.AWX_PROOT_ENABLED and self.should_use_proot(instance):\n # NOTE: Refactor this once we get a newer psutil across the board\n if not psutil:\n os.kill(child.pid, signal.SIGKILL)" } ]
awx
58e9c4ef8717cb5d04b6e495f1065707860b1f8a
8a5e22cb4a50909382d82a00c0f0dd2781a05712
awx/main/migrations/_rbac.py
https://github.com/gconsidine/awx
true
false
true
@@ -408,7 +408,7 @@ def migrate_job_templates(apps, schema_editor): jt.execute_role.members.add(user) logger.info(smart_text(u'adding User({}) access to JobTemplate({})'.format(user.username, jt.name))) - if user in jt.execute_role: + if jt.execute_role.ancestors.filter(members=user).exists(): # aka "user in jt.execute_role" # If the job template is already accessible by the user, because they # are a sytem, organization, or project admin, then don't add an explicit # role entry for them
if user in jt . execute_role :
if jt . execute_role . ancestors . filter ( members = user ) . exists ( ) :
SINGLE_STMT
[["Insert", ["if_statement", 3, 13, 3, 40], ["call", "N0"], 1], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Insert", "N1", ["call", "N3"], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:exists", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["):)", "T"], 1], ["Insert", "N3", ["attribute", "N4"], 0], ["Insert", "N3", ["argument_list", "N5"], 1], ["Insert", "N4", ["attribute", "N6"], 0], ["Insert", "N4", [".:.", "T"], 1], ["Insert", "N4", ["identifier:filter", "T"], 2], ["Insert", "N5", ["(:(", "T"], 0], ["Insert", "N5", ["keyword_argument", "N7"], 1], ["Insert", "N5", ["):)", "T"], 2], ["Move", "N6", ["attribute", 3, 24, 3, 39], 0], ["Insert", "N6", [".:.", "T"], 1], ["Insert", "N6", ["identifier:ancestors", "T"], 2], ["Insert", "N7", ["identifier:members", "T"], 0], ["Insert", "N7", ["=:=", "T"], 1], ["Insert", "N7", ["identifier:user", "T"], 2], ["Delete", ["identifier:user", 3, 16, 3, 20]], ["Delete", ["in:in", 3, 21, 3, 23]], ["Delete", ["comparison_operator", 3, 16, 3, 39]]]
gconsidine/awx@58e9c4ef8717cb5d04b6e495f1065707860b1f8a
Fixed JT migration issue Role.__contains__ is not defined here, so we needed to drop in the implementation instead.
[ { "sha": "706f8dee985ecd01ba90b0822617f2b51d34db02", "filename": "awx/main/migrations/_rbac.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/58e9c4ef8717cb5d04b6e495f1065707860b1f8a/awx%2Fmain%2Fmigrations%2F_rbac.py", "raw_url": "https://github.com/gconsidine/awx/raw/58e9c4ef8717cb5d04b6e495f1065707860b1f8a/awx%2Fmain%2Fmigrations%2F_rbac.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmigrations%2F_rbac.py?ref=58e9c4ef8717cb5d04b6e495f1065707860b1f8a", "patch": "@@ -408,7 +408,7 @@ def migrate_job_templates(apps, schema_editor):\n jt.execute_role.members.add(user)\n logger.info(smart_text(u'adding User({}) access to JobTemplate({})'.format(user.username, jt.name)))\n \n- if user in jt.execute_role:\n+ if jt.execute_role.ancestors.filter(members=user).exists(): # aka \"user in jt.execute_role\"\n # If the job template is already accessible by the user, because they\n # are a sytem, organization, or project admin, then don't add an explicit\n # role entry for them" } ]
awx
082ca59812b830bb7c765e60a72ad6ae033e9219
c4ffab8a3e710b45b84a6a8b934af2a5a14560c1
awx/main/tests/functional/api/test_job_runtime_params.py
https://github.com/gconsidine/awx
true
false
true
@@ -171,7 +171,7 @@ def test_job_launch_fails_without_inventory(deploy_jobtemplate, post, user): args=[deploy_jobtemplate.pk]), {}, user('admin', True)) assert response.status_code == 400 - assert response.data['inventory'] == ['Job Template Inventory is missing or undefined'] + assert response.data['inventory'] == ['Job Template Inventory is missing or undefined.'] @pytest.mark.django_db @pytest.mark.job_runtime_vars
assert response . data [ 'inventory' ] == [ 'Job Template Inventory is missing or undefined' ]
assert response . data [ 'inventory' ] == [ 'Job Template Inventory is missing or undefined.' ]
CHANGE_STRING_LITERAL
[["Update", ["string:'Job Template Inventory is missing or undefined'", 3, 43, 3, 91], "'Job Template Inventory is missing or undefined.'"]]
gconsidine/awx@082ca59812b830bb7c765e60a72ad6ae033e9219
Fixing missed test from period all the things update
[ { "sha": "a1069da198bf0cad183091a737fd968ce689b888", "filename": "awx/main/tests/functional/api/test_job_runtime_params.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/082ca59812b830bb7c765e60a72ad6ae033e9219/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_job_runtime_params.py", "raw_url": "https://github.com/gconsidine/awx/raw/082ca59812b830bb7c765e60a72ad6ae033e9219/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_job_runtime_params.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_job_runtime_params.py?ref=082ca59812b830bb7c765e60a72ad6ae033e9219", "patch": "@@ -171,7 +171,7 @@ def test_job_launch_fails_without_inventory(deploy_jobtemplate, post, user):\n args=[deploy_jobtemplate.pk]), {}, user('admin', True))\n \n assert response.status_code == 400\n- assert response.data['inventory'] == ['Job Template Inventory is missing or undefined']\n+ assert response.data['inventory'] == ['Job Template Inventory is missing or undefined.']\n \n @pytest.mark.django_db\n @pytest.mark.job_runtime_vars" } ]
awx
44d57bf4c31c19cbc0d28f816cad670470e88a0e
87093ec8af4fa7ff912051dedb9fba49056c4b9a
awx/main/tests/functional/api/test_job_runtime_params.py
https://github.com/gconsidine/awx
true
false
true
@@ -159,7 +159,7 @@ def test_job_reject_invalid_prompted_extra_vars(runtime_data, job_template_promp dict(extra_vars='{"unbalanced brackets":'), user('admin', True)) assert response.status_code == 400 - assert response.data['extra_vars'] == ['Must be valid JSON or YAML'] + assert response.data['extra_vars'] == ['Must be a valid JSON or YAML dictionary'] @pytest.mark.django_db @pytest.mark.job_runtime_vars
assert response . data [ 'extra_vars' ] == [ 'Must be valid JSON or YAML' ]
assert response . data [ 'extra_vars' ] == [ 'Must be a valid JSON or YAML dictionary' ]
CHANGE_STRING_LITERAL
[["Update", ["string:'Must be valid JSON or YAML'", 3, 44, 3, 72], "'Must be a valid JSON or YAML dictionary'"]]
gconsidine/awx@44d57bf4c31c19cbc0d28f816cad670470e88a0e
update test to new error message
[ { "sha": "6f76fdf1b60a1ff1207d0c2d727db064d09a5c21", "filename": "awx/main/tests/functional/api/test_job_runtime_params.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/44d57bf4c31c19cbc0d28f816cad670470e88a0e/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_job_runtime_params.py", "raw_url": "https://github.com/gconsidine/awx/raw/44d57bf4c31c19cbc0d28f816cad670470e88a0e/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_job_runtime_params.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_job_runtime_params.py?ref=44d57bf4c31c19cbc0d28f816cad670470e88a0e", "patch": "@@ -159,7 +159,7 @@ def test_job_reject_invalid_prompted_extra_vars(runtime_data, job_template_promp\n dict(extra_vars='{\"unbalanced brackets\":'), user('admin', True))\n \n assert response.status_code == 400\n- assert response.data['extra_vars'] == ['Must be valid JSON or YAML']\n+ assert response.data['extra_vars'] == ['Must be a valid JSON or YAML dictionary']\n \n @pytest.mark.django_db\n @pytest.mark.job_runtime_vars" } ]
awx
db6f50b9f43c66653db3080f6ddfcd6dd48854c9
06f68bc466d42096702551d1fec13428d1d87622
awx/api/serializers.py
https://github.com/gconsidine/awx
true
false
true
@@ -2269,7 +2269,7 @@ class JobLaunchSerializer(BaseSerializer): # Special prohibited cases for scan jobs if 'job_type' in data and obj.ask_job_type_on_launch: if ((obj.job_type==PERM_INVENTORY_SCAN and not data['job_type']==PERM_INVENTORY_SCAN) or - (data.job_type==PERM_INVENTORY_SCAN and not obj['job_type']==PERM_INVENTORY_SCAN)): + (data['job_type']==PERM_INVENTORY_SCAN and not obj['job_type']==PERM_INVENTORY_SCAN)): errors['job_type'] = 'Can not override job_type to or from a scan job.' if (obj.job_type==PERM_INVENTORY_SCAN and ('inventory' in data) and obj.ask_inventory_on_launch and obj.inventory != data['inventory']):
if ( ( obj . job_type == PERM_INVENTORY_SCAN and not data [ 'job_type' ] == PERM_INVENTORY_SCAN ) or ( data . job_type == PERM_INVENTORY_SCAN and not obj [ 'job_type' ] == PERM_INVENTORY_SCAN ) ) : errors [ 'job_type' ] = 'Can not override job_type to or from a scan job.'
if ( ( obj . job_type == PERM_INVENTORY_SCAN and not data [ 'job_type' ] == PERM_INVENTORY_SCAN ) or ( data [ 'job_type' ] == PERM_INVENTORY_SCAN and not obj [ 'job_type' ] == PERM_INVENTORY_SCAN ) ) : errors [ 'job_type' ] = 'Can not override job_type to or from a scan job.'
SINGLE_STMT
[["Insert", ["comparison_operator", 3, 22, 3, 56], ["subscript", "N0"], 0], ["Move", "N0", ["identifier:data", 3, 22, 3, 26], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["string:'job_type'", "T"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Delete", [".:.", 3, 26, 3, 27]], ["Delete", ["identifier:job_type", 3, 27, 3, 35]], ["Delete", ["attribute", 3, 22, 3, 35]]]
gconsidine/awx@db6f50b9f43c66653db3080f6ddfcd6dd48854c9
fix ordereddict programming error
[ { "sha": "55b5c2e3fc6096b710b8af9899f8c2a9a267e3cd", "filename": "awx/api/serializers.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/db6f50b9f43c66653db3080f6ddfcd6dd48854c9/awx%2Fapi%2Fserializers.py", "raw_url": "https://github.com/gconsidine/awx/raw/db6f50b9f43c66653db3080f6ddfcd6dd48854c9/awx%2Fapi%2Fserializers.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=db6f50b9f43c66653db3080f6ddfcd6dd48854c9", "patch": "@@ -2269,7 +2269,7 @@ def validate(self, attrs):\n # Special prohibited cases for scan jobs\n if 'job_type' in data and obj.ask_job_type_on_launch:\n if ((obj.job_type==PERM_INVENTORY_SCAN and not data['job_type']==PERM_INVENTORY_SCAN) or\n- (data.job_type==PERM_INVENTORY_SCAN and not obj['job_type']==PERM_INVENTORY_SCAN)):\n+ (data['job_type']==PERM_INVENTORY_SCAN and not obj['job_type']==PERM_INVENTORY_SCAN)):\n errors['job_type'] = 'Can not override job_type to or from a scan job.'\n if (obj.job_type==PERM_INVENTORY_SCAN and ('inventory' in data) and obj.ask_inventory_on_launch and\n obj.inventory != data['inventory']):" } ]
awx
a79c53bb1742f6ef6856652dc3577b1c547e3163
1faf3cceb8b59c9a4d944fabd479922854e6fdf7
awx/main/tasks.py
https://github.com/gconsidine/awx
true
false
true
@@ -1541,7 +1541,7 @@ class RunAdHocCommand(BaseTask): env['REST_API_URL'] = settings.INTERNAL_API_URL env['REST_API_TOKEN'] = ad_hoc_command.task_auth_token or '' env['CALLBACK_CONSUMER_PORT'] = str(settings.CALLBACK_CONSUMER_PORT) - env['ANSIBLE_SCP_IF_SSH'] = "True" + env['ANSIBLE_SFTP_BATCH_MODE'] = 'False' if getattr(settings, 'JOB_CALLBACK_DEBUG', False): env['JOB_CALLBACK_DEBUG'] = '2' elif settings.DEBUG:
env [ 'ANSIBLE_SCP_IF_SSH' ] = "True"
env [ 'ANSIBLE_SFTP_BATCH_MODE' ] = 'False'
SINGLE_STMT
[["Update", ["string:\"True\"", 3, 37, 3, 43], "'False'"], ["Update", ["string:'ANSIBLE_SCP_IF_SSH'", 3, 13, 3, 33], "'ANSIBLE_SFTP_BATCH_MODE'"]]
gconsidine/awx@a79c53bb1742f6ef6856652dc3577b1c547e3163
Switch to disabling sftp batch instead of scp For ad-hoc jobs where we are experiencing issues related to disabling control persist to support proot. See commit f69846e7871cae41b19ecda33563d6365dc9c3e0 for earlier analysis
[ { "sha": "50ba05a2e538868ccdf80a058323f4279d875148", "filename": "awx/main/tasks.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/a79c53bb1742f6ef6856652dc3577b1c547e3163/awx%2Fmain%2Ftasks.py", "raw_url": "https://github.com/gconsidine/awx/raw/a79c53bb1742f6ef6856652dc3577b1c547e3163/awx%2Fmain%2Ftasks.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftasks.py?ref=a79c53bb1742f6ef6856652dc3577b1c547e3163", "patch": "@@ -1541,7 +1541,7 @@ def build_env(self, ad_hoc_command, **kwargs):\n env['REST_API_URL'] = settings.INTERNAL_API_URL\n env['REST_API_TOKEN'] = ad_hoc_command.task_auth_token or ''\n env['CALLBACK_CONSUMER_PORT'] = str(settings.CALLBACK_CONSUMER_PORT)\n- env['ANSIBLE_SCP_IF_SSH'] = \"True\"\n+ env['ANSIBLE_SFTP_BATCH_MODE'] = 'False'\n if getattr(settings, 'JOB_CALLBACK_DEBUG', False):\n env['JOB_CALLBACK_DEBUG'] = '2'\n elif settings.DEBUG:" } ]
awx
06eb13a104931ba259dee58a3fd0b1ce5cc512b1
ac5bc2aaba63e639acbd05b064becd06a73e592b
awx/api/generics.py
https://github.com/gconsidine/awx
true
false
true
@@ -508,4 +508,4 @@ class ResourceAccessList(ListAPIView): ancestors = set() for r in roles: ancestors.update(set(r.ancestors.all())) - return User.objects.filter(roles__in=list(ancestors)) + return User.objects.filter(roles__in=list(ancestors)).distinct()
return User . objects . filter ( roles__in = list ( ancestors ) )
return User . objects . filter ( roles__in = list ( ancestors ) ) . distinct ( )
ADD_METHOD_CALL
[["Insert", ["call", 3, 16, 3, 62], ["attribute", "N0"], 0], ["Insert", ["call", 3, 16, 3, 62], ["argument_list", "N1"], 1], ["Move", "N0", ["call", 3, 16, 3, 62], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:distinct", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["):)", "T"], 1]]
gconsidine/awx@06eb13a104931ba259dee58a3fd0b1ce5cc512b1
Fixed duplicate users in access_list Uhg.
[ { "sha": "fe1ecd5659d5978b7d60ad9454c1dbfa24a732e5", "filename": "awx/api/generics.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/06eb13a104931ba259dee58a3fd0b1ce5cc512b1/awx%2Fapi%2Fgenerics.py", "raw_url": "https://github.com/gconsidine/awx/raw/06eb13a104931ba259dee58a3fd0b1ce5cc512b1/awx%2Fapi%2Fgenerics.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fgenerics.py?ref=06eb13a104931ba259dee58a3fd0b1ce5cc512b1", "patch": "@@ -508,4 +508,4 @@ def get_queryset(self):\n ancestors = set()\n for r in roles:\n ancestors.update(set(r.ancestors.all()))\n- return User.objects.filter(roles__in=list(ancestors))\n+ return User.objects.filter(roles__in=list(ancestors)).distinct()" } ]
awx
9e562deb0c26adae3342a6be2143e3261a99a3c8
58f142e2e6291f9e280a29dee17067ff6a9bb0c9
awx/api/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -1108,7 +1108,7 @@ class UserList(ListCreateAPIView): serializer_class = UserSerializer def post(self, request, *args, **kwargs): - ret = super(OrganizationUsersList, self).post( request, *args, **kwargs) + ret = super(UserList, self).post( request, *args, **kwargs) if request.data.get('is_system_auditor', False): # This is a faux-field that just maps to checking the system # auditor role member list.. unfortunately this means we can't
ret = super ( OrganizationUsersList , self ) . post ( request , * args , ** kwargs )
ret = super ( UserList , self ) . post ( request , * args , ** kwargs )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:OrganizationUsersList", 3, 21, 3, 42], "UserList"]]
gconsidine/awx@9e562deb0c26adae3342a6be2143e3261a99a3c8
Copy paste error
[ { "sha": "3e1e9ed823a5cc76772fd2ff83cf443c01fc04d4", "filename": "awx/api/views.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/9e562deb0c26adae3342a6be2143e3261a99a3c8/awx%2Fapi%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/9e562deb0c26adae3342a6be2143e3261a99a3c8/awx%2Fapi%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=9e562deb0c26adae3342a6be2143e3261a99a3c8", "patch": "@@ -1108,7 +1108,7 @@ class UserList(ListCreateAPIView):\n serializer_class = UserSerializer\n \n def post(self, request, *args, **kwargs):\n- ret = super(OrganizationUsersList, self).post( request, *args, **kwargs)\n+ ret = super(UserList, self).post( request, *args, **kwargs)\n if request.data.get('is_system_auditor', False):\n # This is a faux-field that just maps to checking the system\n # auditor role member list.. unfortunately this means we can't" } ]
awx
49a2f6b5359691761e82e808b654c214153d233b
9e562deb0c26adae3342a6be2143e3261a99a3c8
awx/api/serializers.py
https://github.com/gconsidine/awx
true
false
false
@@ -679,7 +679,7 @@ class UserSerializer(BaseSerializer): password = serializers.CharField(required=False, default='', write_only=True, help_text='Write-only field used to change the password.') ldap_dn = serializers.CharField(source='profile.ldap_dn', read_only=True) - is_system_auditor = serializers.BooleanField() + is_system_auditor = serializers.BooleanField(default=False) class Meta: model = User
is_system_auditor = serializers . BooleanField ( )
is_system_auditor = serializers . BooleanField ( default = False )
SAME_FUNCTION_MORE_ARGS
[["Insert", ["argument_list", 3, 49, 3, 51], ["keyword_argument", "N0"], 1], ["Insert", "N0", ["identifier:default", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["false:False", "T"], 2]]
gconsidine/awx@49a2f6b5359691761e82e808b654c214153d233b
Default is_system_auditor to False in serializer for API compatibility
[ { "sha": "7b4b45c3160d0f774b89f44294f319403190bbd3", "filename": "awx/api/serializers.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/49a2f6b5359691761e82e808b654c214153d233b/awx%2Fapi%2Fserializers.py", "raw_url": "https://github.com/gconsidine/awx/raw/49a2f6b5359691761e82e808b654c214153d233b/awx%2Fapi%2Fserializers.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=49a2f6b5359691761e82e808b654c214153d233b", "patch": "@@ -679,7 +679,7 @@ class UserSerializer(BaseSerializer):\n password = serializers.CharField(required=False, default='', write_only=True,\n help_text='Write-only field used to change the password.')\n ldap_dn = serializers.CharField(source='profile.ldap_dn', read_only=True)\n- is_system_auditor = serializers.BooleanField()\n+ is_system_auditor = serializers.BooleanField(default=False)\n \n class Meta:\n model = User" } ]
awx
9ed77508a72fc7e998badfe670926d0cd4dbb385
0f742fb7a7080b1311c09e0434119a226b9bdc42
awx/main/signals.py
https://github.com/gconsidine/awx
true
false
true
@@ -409,7 +409,7 @@ def activity_stream_associate(sender, instance, **kwargs): # If the m2m is from the User side we need to # set the content_object of the Role for our entry. if type(instance) == User and role.content_object is not None: - getattr(activity_entry, role.content_type.name).add(role.content_object) + getattr(activity_entry, role.content_type.name.replace(' ', '_')).add(role.content_object) activity_entry.role.add(role) activity_entry.object_relationship_type = obj_rel
getattr ( activity_entry , role . content_type . name ) . add ( role . content_object )
getattr ( activity_entry , role . content_type . name . replace ( ' ' , '_' ) ) . add ( role . content_object )
ADD_METHOD_CALL
[["Insert", ["argument_list", 3, 28, 3, 68], ["call", "N0"], 3], ["Insert", ["argument_list", 3, 28, 3, 68], ["):)", "T"], 4], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["attribute", 3, 45, 3, 67], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:replace", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["string:' '", "T"], 1], ["Insert", "N2", [",:,", "T"], 2], ["Insert", "N2", ["string:'_'", "T"], 3], ["Move", "N2", ["):)", 3, 67, 3, 68], 4]]
gconsidine/awx@9ed77508a72fc7e998badfe670926d0cd4dbb385
fix naming problem with ActivityStream logging
[ { "sha": "f7b1845ae996dc39992b3d5668dbceb1af07228c", "filename": "awx/main/signals.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/9ed77508a72fc7e998badfe670926d0cd4dbb385/awx%2Fmain%2Fsignals.py", "raw_url": "https://github.com/gconsidine/awx/raw/9ed77508a72fc7e998badfe670926d0cd4dbb385/awx%2Fmain%2Fsignals.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fsignals.py?ref=9ed77508a72fc7e998badfe670926d0cd4dbb385", "patch": "@@ -409,7 +409,7 @@ def activity_stream_associate(sender, instance, **kwargs):\n # If the m2m is from the User side we need to\n # set the content_object of the Role for our entry.\n if type(instance) == User and role.content_object is not None:\n- getattr(activity_entry, role.content_type.name).add(role.content_object)\n+ getattr(activity_entry, role.content_type.name.replace(' ', '_')).add(role.content_object)\n \n activity_entry.role.add(role)\n activity_entry.object_relationship_type = obj_rel" } ]
awx
1abba522b03fb854201c141c5e72e7281d6c94fc
bef61f4003385134b89993bad9daddbbccecd096
awx/api/filters.py
https://github.com/gconsidine/awx
true
false
true
@@ -219,7 +219,7 @@ class FieldLookupBackend(BaseFilterBackend): else: q = Q(**{k:v}) queryset = queryset.filter(q) - queryset = queryset.filter(*args) + queryset = queryset.filter(*args).distinct() return queryset except (FieldError, FieldDoesNotExist, ValueError), e: raise ParseError(e.args[0])
queryset = queryset . filter ( * args )
queryset = queryset . filter ( * args ) . distinct ( )
ADD_METHOD_CALL
[["Insert", ["call", 3, 28, 3, 50], ["attribute", "N0"], 0], ["Insert", ["call", 3, 28, 3, 50], ["argument_list", "N1"], 1], ["Move", "N0", ["call", 3, 28, 3, 50], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:distinct", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["):)", "T"], 1]]
gconsidine/awx@1abba522b03fb854201c141c5e72e7281d6c94fc
Resurrect global .distinct() call (mostly) This mostly reverts 3c67971e78a12bd94536aa5464f0bc1ea46ba1ee with the minor difference that we only apply this when we're filtering, which is apparently necessary without some notable overhaul since the filtering we're doing will get stuck in as filters, which will generate inner joins, which can result in duplicates if the thing we're joining with is a one to many or many to many, which most things are. With this patch we still need to be generating naturally distinct querysets with any `get_queryset` methods, which will still be much more effecient when filtering is not involved. This fixes #2032 and probably a bunch of other undiscovered issues.
[ { "sha": "f4e65a8d82304efc7d72e3a7592218becffe873d", "filename": "awx/api/filters.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/1abba522b03fb854201c141c5e72e7281d6c94fc/awx%2Fapi%2Ffilters.py", "raw_url": "https://github.com/gconsidine/awx/raw/1abba522b03fb854201c141c5e72e7281d6c94fc/awx%2Fapi%2Ffilters.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Ffilters.py?ref=1abba522b03fb854201c141c5e72e7281d6c94fc", "patch": "@@ -219,7 +219,7 @@ def filter_queryset(self, request, queryset, view):\n else:\n q = Q(**{k:v})\n queryset = queryset.filter(q)\n- queryset = queryset.filter(*args)\n+ queryset = queryset.filter(*args).distinct()\n return queryset\n except (FieldError, FieldDoesNotExist, ValueError), e:\n raise ParseError(e.args[0])" } ]
awx
fa010c2228f706d85241bea6186f91b7c32428df
aaabc2582d27056f16df8b59ddffc31c521a2cfb
awx/main/tests/factories/tower.py
https://github.com/gconsidine/awx
true
false
true
@@ -255,7 +255,7 @@ def create_organization(name, **kwargs): if type(l) is Label: labels[l.name] = l else: - labels[l] = mk_label(l, org, persisted=persisted) + labels[l] = mk_label(l, organization=org, persisted=persisted) apply_roles(kwargs.get('roles'), [superusers, users, teams, projects, labels], persisted) return Objects(organization=org,
labels [ l ] = mk_label ( l , org , persisted = persisted )
labels [ l ] = mk_label ( l , organization = org , persisted = persisted )
SINGLE_STMT
[["Insert", ["argument_list", 3, 37, 3, 66], ["keyword_argument", "N0"], 3], ["Insert", "N0", ["identifier:organization", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Move", "N0", ["identifier:org", 3, 41, 3, 44], 2]]
gconsidine/awx@fa010c2228f706d85241bea6186f91b7c32428df
fix mk_label method
[ { "sha": "7379cf4e6c77142aa166417681d94c3fc99e4ac2", "filename": "awx/main/tests/factories/tower.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/fa010c2228f706d85241bea6186f91b7c32428df/awx%2Fmain%2Ftests%2Ffactories%2Ftower.py", "raw_url": "https://github.com/gconsidine/awx/raw/fa010c2228f706d85241bea6186f91b7c32428df/awx%2Fmain%2Ftests%2Ffactories%2Ftower.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Ffactories%2Ftower.py?ref=fa010c2228f706d85241bea6186f91b7c32428df", "patch": "@@ -255,7 +255,7 @@ def create_organization(name, **kwargs):\n if type(l) is Label:\n labels[l.name] = l\n else:\n- labels[l] = mk_label(l, org, persisted=persisted)\n+ labels[l] = mk_label(l, organization=org, persisted=persisted)\n \n apply_roles(kwargs.get('roles'), [superusers, users, teams, projects, labels], persisted)\n return Objects(organization=org," } ]
awx
2cb69ffce08f0b01ebc72776bee816eaddd282be
7fc62cd401abc3f11eef4c7b7169833b2698f797
awx/api/serializers.py
https://github.com/gconsidine/awx
true
false
false
@@ -1212,7 +1212,7 @@ class GroupSerializer(BaseSerializerWithVariables): class GroupTreeSerializer(GroupSerializer): - children = serializers.SerializerMethodField('get_children') + children = serializers.SerializerMethodField() class Meta: model = Group
children = serializers . SerializerMethodField ( 'get_children' )
children = serializers . SerializerMethodField ( )
SAME_FUNCTION_LESS_ARGS
[["Delete", ["string:'get_children'", 3, 50, 3, 64]]]
gconsidine/awx@2cb69ffce08f0b01ebc72776bee816eaddd282be
Fixed assertion error for inventory tree serializer.
[ { "sha": "ba6791a41c2a340b36e85e145be2bffdd55850ac", "filename": "awx/api/serializers.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/2cb69ffce08f0b01ebc72776bee816eaddd282be/awx%2Fapi%2Fserializers.py", "raw_url": "https://github.com/gconsidine/awx/raw/2cb69ffce08f0b01ebc72776bee816eaddd282be/awx%2Fapi%2Fserializers.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=2cb69ffce08f0b01ebc72776bee816eaddd282be", "patch": "@@ -1212,7 +1212,7 @@ def to_representation(self, obj):\n \n class GroupTreeSerializer(GroupSerializer):\n \n- children = serializers.SerializerMethodField('get_children')\n+ children = serializers.SerializerMethodField()\n \n class Meta:\n model = Group" } ]
awx
f545640f58ca45c0d510a1923953711812e19842
902787b63beb0c4487b963185365a86c3c83c1ee
awx/main/tasks.py
https://github.com/gconsidine/awx
true
false
true
@@ -1712,7 +1712,7 @@ class RunSystemJob(BaseTask): return args def build_env(self, instance, **kwargs): - env = super(RunSystemJob, self).build_env(inventory_update, + env = super(RunSystemJob, self).build_env(instance, **kwargs) env = self.add_tower_venv(env) return env
env = super ( RunSystemJob , self ) . build_env ( inventory_update , ** kwargs )
env = super ( RunSystemJob , self ) . build_env ( instance , ** kwargs )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:inventory_update", 3, 51, 3, 67], "instance"]]
gconsidine/awx@f545640f58ca45c0d510a1923953711812e19842
Fix an issue calling build_env for system jobs
[ { "sha": "41d8b04c918709da48e2bf64d6d80a463352d970", "filename": "awx/main/tasks.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/f545640f58ca45c0d510a1923953711812e19842/awx%2Fmain%2Ftasks.py", "raw_url": "https://github.com/gconsidine/awx/raw/f545640f58ca45c0d510a1923953711812e19842/awx%2Fmain%2Ftasks.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftasks.py?ref=f545640f58ca45c0d510a1923953711812e19842", "patch": "@@ -1712,7 +1712,7 @@ def build_args(self, system_job, **kwargs):\n return args\n \n def build_env(self, instance, **kwargs):\n- env = super(RunSystemJob, self).build_env(inventory_update,\n+ env = super(RunSystemJob, self).build_env(instance,\n **kwargs)\n env = self.add_tower_venv(env)\n return env" } ]
awx
019c5bac045955f6b207e6d658aef4a6fb3870e4
db1647883025952d348d0c9ee9aadd8cd9623393
awx/main/tests/functional/api/test_activity_streams.py
https://github.com/gconsidine/awx
true
false
true
@@ -13,7 +13,7 @@ def mock_feature_enabled(feature, bypass_database=None): @pytest.fixture def activity_stream_entry(organization, org_admin): - return ActivityStream.objects.filter(organization__pk=organization.pk, operation='associate').first() + return ActivityStream.objects.filter(organization__pk=organization.pk, user=org_admin, operation='associate').first() @pytest.mark.skipif(not getattr(settings, 'ACTIVITY_STREAM_ENABLED', True), reason="Activity stream not enabled") @mock.patch('awx.api.views.feature_enabled', new=mock_feature_enabled)
return ActivityStream . objects . filter ( organization__pk = organization . pk , operation = 'associate' ) . first ( )
return ActivityStream . objects . filter ( organization__pk = organization . pk , user = org_admin , operation = 'associate' ) . first ( )
SAME_FUNCTION_MORE_ARGS
[["Insert", ["argument_list", 3, 41, 3, 98], ["keyword_argument", "N0"], 3], ["Insert", ["argument_list", 3, 41, 3, 98], [",:,", "T"], 4], ["Insert", "N0", ["identifier:user", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["identifier:org_admin", "T"], 2]]
gconsidine/awx@019c5bac045955f6b207e6d658aef4a6fb3870e4
fix tests to be more specific about AS query
[ { "sha": "f1c42cdd9dbe4ee4a0f4ace66bc808248a6b52e1", "filename": "awx/main/tests/functional/api/test_activity_streams.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/019c5bac045955f6b207e6d658aef4a6fb3870e4/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_activity_streams.py", "raw_url": "https://github.com/gconsidine/awx/raw/019c5bac045955f6b207e6d658aef4a6fb3870e4/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_activity_streams.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_activity_streams.py?ref=019c5bac045955f6b207e6d658aef4a6fb3870e4", "patch": "@@ -13,7 +13,7 @@ def mock_feature_enabled(feature, bypass_database=None):\n \n @pytest.fixture\n def activity_stream_entry(organization, org_admin):\n- return ActivityStream.objects.filter(organization__pk=organization.pk, operation='associate').first()\n+ return ActivityStream.objects.filter(organization__pk=organization.pk, user=org_admin, operation='associate').first()\n \n @pytest.mark.skipif(not getattr(settings, 'ACTIVITY_STREAM_ENABLED', True), reason=\"Activity stream not enabled\")\n @mock.patch('awx.api.views.feature_enabled', new=mock_feature_enabled)" } ]
awx
960b6e22aaf33dc3f7e0558d1edcc58d7d59d750
8d67d3a6fc695febfb08687c811737947dbd247b
awx/api/views.py
https://github.com/gconsidine/awx
true
false
true
@@ -1338,7 +1338,7 @@ class CredentialOwnerTeamsList(SubListAPIView): def get_queryset(self): credential = get_object_or_404(self.parent_model, pk=self.kwargs['pk']) - if not self.request.user.can_access(Credential, 'read', None): + if not self.request.user.can_access(Credential, 'read', credential): raise PermissionDenied() content_type = ContentType.objects.get_for_model(self.model)
if not self . request . user . can_access ( Credential , 'read' , None ) : raise PermissionDenied ( )
if not self . request . user . can_access ( Credential , 'read' , credential ) : raise PermissionDenied ( )
SINGLE_TOKEN
[["Insert", ["argument_list", 3, 44, 3, 70], ["identifier:credential", "T"], 5], ["Delete", ["none:None", 3, 65, 3, 69]]]
gconsidine/awx@960b6e22aaf33dc3f7e0558d1edcc58d7d59d750
Fix up broken CredentialOwnerTeams view Missing the object when requesting whether the user can access it or not
[ { "sha": "ab4469784388c545f70f35e082fd15a53029ec66", "filename": "awx/api/views.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/960b6e22aaf33dc3f7e0558d1edcc58d7d59d750/awx%2Fapi%2Fviews.py", "raw_url": "https://github.com/gconsidine/awx/raw/960b6e22aaf33dc3f7e0558d1edcc58d7d59d750/awx%2Fapi%2Fviews.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=960b6e22aaf33dc3f7e0558d1edcc58d7d59d750", "patch": "@@ -1338,7 +1338,7 @@ class CredentialOwnerTeamsList(SubListAPIView):\n \n def get_queryset(self):\n credential = get_object_or_404(self.parent_model, pk=self.kwargs['pk'])\n- if not self.request.user.can_access(Credential, 'read', None):\n+ if not self.request.user.can_access(Credential, 'read', credential):\n raise PermissionDenied()\n \n content_type = ContentType.objects.get_for_model(self.model)" } ]
awx
d8f11459c9102c3b19145691efc6c295c03d19a0
68d47cfc93162f56deaa64cc8ddb2d830705647d
awx/api/serializers.py
https://github.com/gconsidine/awx
true
false
true
@@ -1279,7 +1279,7 @@ class CustomInventoryScriptSerializer(BaseSerializer): if obj is None: return ret request = self.context.get('request', None) - if not request.user in obj.admin_role: + if request.user not in obj.admin_role: ret['script'] = None return ret
if not request . user in obj . admin_role : ret [ 'script' ] = None
if request . user not in obj . admin_role : ret [ 'script' ] = None
SINGLE_STMT
[["Move", ["if_statement", 3, 9, 4, 33], ["comparison_operator", 3, 16, 3, 46], 1], ["Insert", ["comparison_operator", 3, 16, 3, 46], ["not:not", "T"], 1], ["Delete", ["not:not", 3, 12, 3, 15]], ["Delete", ["not_operator", 3, 12, 3, 46]]]
gconsidine/awx@d8f11459c9102c3b19145691efc6c295c03d19a0
flake8 fix membership in seralizer
[ { "sha": "2f2af5e6fb5506b369e6676ade17ea058dbf4cdd", "filename": "awx/api/serializers.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/d8f11459c9102c3b19145691efc6c295c03d19a0/awx%2Fapi%2Fserializers.py", "raw_url": "https://github.com/gconsidine/awx/raw/d8f11459c9102c3b19145691efc6c295c03d19a0/awx%2Fapi%2Fserializers.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=d8f11459c9102c3b19145691efc6c295c03d19a0", "patch": "@@ -1279,7 +1279,7 @@ def to_representation(self, obj):\n if obj is None:\n return ret\n request = self.context.get('request', None)\n- if not request.user in obj.admin_role:\n+ if request.user not in obj.admin_role:\n ret['script'] = None\n return ret\n " } ]
awx
152ddc4f4f2d43b19db68d506d96fec64729302a
b579b76099559d28b6bdcea5404ef27f29c95a77
awx/main/tasks.py
https://github.com/gconsidine/awx
true
false
true
@@ -191,7 +191,7 @@ def handle_work_error(self, task_id, subtasks=None): if instance.celery_task_id != task_id: instance.status = 'failed' instance.failed = True - instance.job_explanation = 'Previous Task Failed: {"task_type": "%s", "task_name": "%s", "task_id": "%s"}' % \ + instance.job_explanation = 'Previous Task Failed: {"job_type": "%s", "job_name": "%s", "job_id": "%s"}' % \ (first_task_type, first_task_name, first_task_id) instance.save() instance.socketio_emit_status("failed")
instance . job_explanation = 'Previous Task Failed: {"task_type": "%s", "task_name": "%s", "task_id": "%s"}' % ( first_task_type , first_task_name , first_task_id )
instance . job_explanation = 'Previous Task Failed: {"job_type": "%s", "job_name": "%s", "job_id": "%s"}' % ( first_task_type , first_task_name , first_task_id )
CHANGE_BINARY_OPERAND
[["Update", ["string:'Previous Task Failed: {\"task_type\": \"%s\", \"task_name\": \"%s\", \"task_id\": \"%s\"}'", 3, 44, 3, 123], "'Previous Task Failed: {\"job_type\": \"%s\", \"job_name\": \"%s\", \"job_id\": \"%s\"}'"]]
gconsidine/awx@152ddc4f4f2d43b19db68d506d96fec64729302a
Rename task_ to job_ for pre-task fail error
[ { "sha": "b18df63b92ba3d9d57c1d241f263b27282de1829", "filename": "awx/main/tasks.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/152ddc4f4f2d43b19db68d506d96fec64729302a/awx%2Fmain%2Ftasks.py", "raw_url": "https://github.com/gconsidine/awx/raw/152ddc4f4f2d43b19db68d506d96fec64729302a/awx%2Fmain%2Ftasks.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftasks.py?ref=152ddc4f4f2d43b19db68d506d96fec64729302a", "patch": "@@ -191,7 +191,7 @@ def handle_work_error(self, task_id, subtasks=None):\n if instance.celery_task_id != task_id:\n instance.status = 'failed'\n instance.failed = True\n- instance.job_explanation = 'Previous Task Failed: {\"task_type\": \"%s\", \"task_name\": \"%s\", \"task_id\": \"%s\"}' % \\\n+ instance.job_explanation = 'Previous Task Failed: {\"job_type\": \"%s\", \"job_name\": \"%s\", \"job_id\": \"%s\"}' % \\\n (first_task_type, first_task_name, first_task_id)\n instance.save()\n instance.socketio_emit_status(\"failed\")" } ]
awx
98965d4792e63aee1b2fef660d03363beae2cb1d
564f9e2c586428604d706573f50a99fba9fee879
awx/main/middleware.py
https://github.com/gconsidine/awx
true
false
true
@@ -67,7 +67,7 @@ class ActivityStreamMiddleware(threading.local): user = user[0] instance.actor = user else: - instance.actor = AnonymouseUser + instance.actor = AnonymousUser instance.save(update_fields=['actor']) else: if instance.id not in self.instance_ids:
else : instance . actor = AnonymouseUser
else : instance . actor = AnonymousUser
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:AnonymouseUser", 3, 38, 3, 52], "AnonymousUser"]]
gconsidine/awx@98965d4792e63aee1b2fef660d03363beae2cb1d
Fix typo in AnonymousUser
[ { "sha": "0c08ce40fb1d72f914cbe57a4d787b756599db70", "filename": "awx/main/middleware.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/98965d4792e63aee1b2fef660d03363beae2cb1d/awx%2Fmain%2Fmiddleware.py", "raw_url": "https://github.com/gconsidine/awx/raw/98965d4792e63aee1b2fef660d03363beae2cb1d/awx%2Fmain%2Fmiddleware.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmiddleware.py?ref=98965d4792e63aee1b2fef660d03363beae2cb1d", "patch": "@@ -67,7 +67,7 @@ def set_actor(self, user, sender, instance, **kwargs):\n user = user[0]\n instance.actor = user\n else:\n- instance.actor = AnonymouseUser\n+ instance.actor = AnonymousUser\n instance.save(update_fields=['actor'])\n else:\n if instance.id not in self.instance_ids:" } ]
awx
76b02cde054d2bc134a3fe49feafdda2c8ff534e
54ad2eba8d2bbc8f1b07220c0c4e0339a4060bad
awx/api/serializers.py
https://github.com/gconsidine/awx
true
false
true
@@ -1505,7 +1505,7 @@ class JobTemplateSerializer(UnifiedJobTemplateSerializer, JobOptionsSerializer): else: d['can_copy'] = False d['can_edit'] = False - d['recent_jobs'] = [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-started')[:10]] + d['recent_jobs'] = [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-created')[:10]] return d def validate_survey_enabled(self, attrs, source):
d [ 'recent_jobs' ] = [ { 'id' : x . id , 'status' : x . status , 'finished' : x . finished } for x in obj . jobs . filter ( active = True ) . order_by ( '-started' ) [ : 10 ] ]
d [ 'recent_jobs' ] = [ { 'id' : x . id , 'status' : x . status , 'finished' : x . finished } for x in obj . jobs . filter ( active = True ) . order_by ( '-created' ) [ : 10 ] ]
CHANGE_STRING_LITERAL
[["Update", ["string:'-started'", 3, 133, 3, 143], "'-created'"]]
gconsidine/awx@76b02cde054d2bc134a3fe49feafdda2c8ff534e
Fix job template job sorting "started" isn't a good field to sort on as it can be Null. "created" will always be available.
[ { "sha": "bf258cc5246e05ffe509e0538eacc1f102f258e4", "filename": "awx/api/serializers.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/76b02cde054d2bc134a3fe49feafdda2c8ff534e/awx%2Fapi%2Fserializers.py", "raw_url": "https://github.com/gconsidine/awx/raw/76b02cde054d2bc134a3fe49feafdda2c8ff534e/awx%2Fapi%2Fserializers.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=76b02cde054d2bc134a3fe49feafdda2c8ff534e", "patch": "@@ -1505,7 +1505,7 @@ def get_summary_fields(self, obj):\n else:\n d['can_copy'] = False\n d['can_edit'] = False\n- d['recent_jobs'] = [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-started')[:10]]\n+ d['recent_jobs'] = [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-created')[:10]]\n return d\n \n def validate_survey_enabled(self, attrs, source):" } ]
awx
13c80375eab2ca44db51295dbae975cc21f57c46
e69fdfa79b4fd976be891147ece4095fc8c61371
awx/api/serializers.py
https://github.com/gconsidine/awx
true
false
true
@@ -1505,7 +1505,7 @@ class JobTemplateSerializer(UnifiedJobTemplateSerializer, JobOptionsSerializer): else: d['can_copy'] = False d['can_edit'] = False - d['recent_jobs'] = [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-started')[:10]] + d['recent_jobs'] = [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-created')[:10]] return d def validate_survey_enabled(self, attrs, source):
d [ 'recent_jobs' ] = [ { 'id' : x . id , 'status' : x . status , 'finished' : x . finished } for x in obj . jobs . filter ( active = True ) . order_by ( '-started' ) [ : 10 ] ]
d [ 'recent_jobs' ] = [ { 'id' : x . id , 'status' : x . status , 'finished' : x . finished } for x in obj . jobs . filter ( active = True ) . order_by ( '-created' ) [ : 10 ] ]
CHANGE_STRING_LITERAL
[["Update", ["string:'-started'", 3, 133, 3, 143], "'-created'"]]
gconsidine/awx@13c80375eab2ca44db51295dbae975cc21f57c46
Fix job template job sorting "started" isn't a good field to sort on as it can be Null. "created" will always be available.
[ { "sha": "bf258cc5246e05ffe509e0538eacc1f102f258e4", "filename": "awx/api/serializers.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/13c80375eab2ca44db51295dbae975cc21f57c46/awx%2Fapi%2Fserializers.py", "raw_url": "https://github.com/gconsidine/awx/raw/13c80375eab2ca44db51295dbae975cc21f57c46/awx%2Fapi%2Fserializers.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=13c80375eab2ca44db51295dbae975cc21f57c46", "patch": "@@ -1505,7 +1505,7 @@ def get_summary_fields(self, obj):\n else:\n d['can_copy'] = False\n d['can_edit'] = False\n- d['recent_jobs'] = [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-started')[:10]]\n+ d['recent_jobs'] = [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-created')[:10]]\n return d\n \n def validate_survey_enabled(self, attrs, source):" } ]
awx
780b27e0edc6b6f635ea869bec8dea601a251d37
3315183810826d88effeb33a95c64d814b933831
awx/main/models/jobs.py
https://github.com/gconsidine/awx
true
false
true
@@ -293,7 +293,7 @@ class JobTemplate(UnifiedJobTemplate, JobOptions): # Overwrite with job template extra vars with survey default vars if self.survey_enabled and 'spec' in self.survey_spec: for survey_element in self.survey_spec.get("spec", []): - if survey_element['default']: + if 'default' in survey_element and survey_element['default']: extra_vars[survey_element['variable']] = survey_element['default'] # transform to dict
if survey_element [ 'default' ] : extra_vars [ survey_element [ 'variable' ] ] = survey_element [ 'default' ]
if 'default' in survey_element and survey_element [ 'default' ] : extra_vars [ survey_element [ 'variable' ] ] = survey_element [ 'default' ]
MORE_SPECIFIC_IF
[["Insert", ["if_statement", 3, 17, 4, 87], ["boolean_operator", "N0"], 1], ["Insert", "N0", ["comparison_operator", "N1"], 0], ["Insert", "N0", ["and:and", "T"], 1], ["Move", "N0", ["subscript", 3, 20, 3, 45], 2], ["Insert", "N1", ["string:'default'", "T"], 0], ["Insert", "N1", ["in:in", "T"], 1], ["Insert", "N1", ["identifier:survey_element", "T"], 2]]
gconsidine/awx@780b27e0edc6b6f635ea869bec8dea601a251d37
Don't hard-fail if default isn't defined on survey
[ { "sha": "ebc6a0fa785209783105f5d2455e89aafedda5f5", "filename": "awx/main/models/jobs.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/780b27e0edc6b6f635ea869bec8dea601a251d37/awx%2Fmain%2Fmodels%2Fjobs.py", "raw_url": "https://github.com/gconsidine/awx/raw/780b27e0edc6b6f635ea869bec8dea601a251d37/awx%2Fmain%2Fmodels%2Fjobs.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Fjobs.py?ref=780b27e0edc6b6f635ea869bec8dea601a251d37", "patch": "@@ -293,7 +293,7 @@ def _update_unified_job_kwargs(self, **kwargs):\n # Overwrite with job template extra vars with survey default vars\n if self.survey_enabled and 'spec' in self.survey_spec:\n for survey_element in self.survey_spec.get(\"spec\", []):\n- if survey_element['default']:\n+ if 'default' in survey_element and survey_element['default']:\n extra_vars[survey_element['variable']] = survey_element['default']\n \n # transform to dict" } ]