1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-27 17:55:10 +03:00

Make spelling of canceled consistent

This commit is contained in:
Christian Adams 2019-11-26 00:30:53 -05:00
parent c87c0aa712
commit 4f8b624b96
9 changed files with 20 additions and 20 deletions

View File

@ -1,7 +1,7 @@
# Cancel Inventory Update
Make a GET request to this resource to determine if the inventory update can be
cancelled. The response will include the following field:
canceled. The response will include the following field:
* `can_cancel`: Indicates whether this update can be canceled (boolean,
read-only)

View File

@ -1,7 +1,7 @@
{% ifmeth GET %}
# Determine if a Job can be cancelled
# Determine if a Job can be canceled
Make a GET request to this resource to determine if the job can be cancelled.
Make a GET request to this resource to determine if the job can be canceled.
The response will include the following field:
* `can_cancel`: Indicates whether this job can be canceled (boolean, read-only)

View File

@ -1,7 +1,7 @@
# Cancel Project Update
Make a GET request to this resource to determine if the project update can be
cancelled. The response will include the following field:
canceled. The response will include the following field:
* `can_cancel`: Indicates whether this update can be canceled (boolean,
read-only)

View File

@ -32,13 +32,13 @@ def set_pythonpath(venv_libdir, env):
class IsolatedManager(object):
def __init__(self, cancelled_callback=None, check_callback=None, pod_manager=None):
def __init__(self, canceled_callback=None, check_callback=None, pod_manager=None):
"""
:param cancelled_callback: a callable - which returns `True` or `False`
:param canceled_callback: a callable - which returns `True` or `False`
- signifying if the job has been prematurely
cancelled
canceled
"""
self.cancelled_callback = cancelled_callback
self.canceled_callback = canceled_callback
self.check_callback = check_callback
self.started_at = None
self.captured_command_artifact = False
@ -105,7 +105,7 @@ class IsolatedManager(object):
'envvars': env,
'finished_callback': finished_callback,
'verbosity': verbosity,
'cancel_callback': self.cancelled_callback,
'cancel_callback': self.canceled_callback,
'settings': {
'job_timeout': settings.AWX_ISOLATED_LAUNCH_TIMEOUT,
'pexpect_timeout': getattr(settings, 'PEXPECT_TIMEOUT', 5),
@ -209,14 +209,14 @@ class IsolatedManager(object):
dispatcher = CallbackQueueDispatcher()
while status == 'failed':
canceled = self.cancelled_callback() if self.cancelled_callback else False
canceled = self.canceled_callback() if self.canceled_callback else False
if not canceled and time.time() - last_check < interval:
# If the job isn't cancelled, but we haven't waited `interval` seconds, wait longer
# If the job isn't canceled, but we haven't waited `interval` seconds, wait longer
time.sleep(1)
continue
if canceled:
logger.warning('Isolated job {} was manually cancelled.'.format(self.instance.id))
logger.warning('Isolated job {} was manually canceled.'.format(self.instance.id))
logger.debug('Checking on isolated job {} with `check_isolated.yml`.'.format(self.instance.id))
runner_obj = self.run_management_playbook('check_isolated.yml',

View File

@ -1336,7 +1336,7 @@ class BaseTask(object):
ansible_runner.utils.dump_artifacts(params)
isolated_manager_instance = isolated_manager.IsolatedManager(
cancelled_callback=lambda: self.update_model(self.instance.pk).cancel_flag,
canceled_callback=lambda: self.update_model(self.instance.pk).cancel_flag,
check_callback=self.check_handler,
pod_manager=pod_manager
)
@ -2154,7 +2154,7 @@ class RunProjectUpdate(BaseTask):
try:
instance.refresh_from_db(fields=['cancel_flag'])
if instance.cancel_flag:
logger.debug("ProjectUpdate({0}) was cancelled".format(instance.pk))
logger.debug("ProjectUpdate({0}) was canceled".format(instance.pk))
return
fcntl.lockf(self.lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
break

View File

@ -29,7 +29,7 @@ export default
Rest.post()
.then(() => {
Wait('stop');
//Alert('Inventory Sync Cancelled', 'Request to cancel the sync process was submitted to the task manger. ' +
//Alert('Inventory Sync Canceled', 'Request to cancel the sync process was submitted to the task manger. ' +
// 'Click the <i class="fa fa-refresh fa-lg"></i> button to monitor the status.', 'alert-info');
})
.catch(({data, status}) => {

View File

@ -646,7 +646,7 @@ export default ['moment', '$timeout', '$window', '$filter', 'TemplatesStrings',
if(d.job.status === "successful"){
return "#5cb85c";
}
else if (d.job.status === "failed" || d.job.status === "error" || d.job.status === "cancelled") {
else if (d.job.status === "failed" || d.job.status === "error" || d.job.status === "canceled") {
return "#d9534f";
}
else {
@ -913,7 +913,7 @@ export default ['moment', '$timeout', '$window', '$filter', 'TemplatesStrings',
if(d.job.status === "successful"){
return "#5cb85c";
}
else if (d.job.status === "failed" || d.job.status === "error" || d.job.status === "cancelled") {
else if (d.job.status === "failed" || d.job.status === "error" || d.job.status === "canceled") {
return "#d9534f";
}
else {

View File

@ -283,11 +283,11 @@ mountWithContexts(<Organization />< {
## Internationalization
Internationalization leans on the [lingui](https://github.com/lingui/js-lingui) project. [Official documentation here](https://lingui.js.org/). We use this libary to mark our strings for translation. If you want to see this in action you'll need to take the following steps:
Internationalization leans on the [lingui](https://github.com/lingui/js-lingui) project. [Official documentation here](https://lingui.js.org/). We use this library to mark our strings for translation. If you want to see this in action you'll need to take the following steps:
### Marking strings for translation and replacement in the UI
The lingui library provides various React helpers for dealing with both marking strings for translation, and replacing strings that have been traslated. For consistency and ease of use, we have consolidated on one pattern for the codebase. To set strings to be translated in the UI:
The lingui library provides various React helpers for dealing with both marking strings for translation, and replacing strings that have been translated. For consistency and ease of use, we have consolidated on one pattern for the codebase. To set strings to be translated in the UI:
- import the withI18n function and wrap the export of your component in it (i.e. `export default withI18n()(Foo)`)
- doing the above gives you access to the i18n object on props. Make sure to put it in the scope of the function that contains strings needed to be translated (i.e. `const { i18n } = this.props;`)

View File

@ -22,7 +22,7 @@ STATUS_COLORS = {
'successful': 'green',
'failed': 'red',
'error': 'red',
'cancelled': 'grey',
'canceled': 'grey',
}