1. no_voting for lower-constraints CI
2.pep8 create: /home/zuul/src/opendev.org/openstack/freezer/.tox/pep8
pep8 installdeps: -c/home/zuul/src/opendev.org/openstack/requirements/upper-constraints.txt, -r/home/zuul/src/opendev.org/openstack/freezer/test-requirements.txt
ERROR: invocation failed (exit code 1), logfile: /home/zuul/src/opendev.org/openstack/freezer/.tox/pep8/log/pep8-1.log
================================== log start ===================================
Looking in indexes: https://mirror.bhs1.ovh.opendev.org/pypi/simple, https://mirror.bhs1.ovh.opendev.org/wheel/ubuntu-20.04-x86_64
Collecting astroid==2.1.0
Downloading 8809bc008b36396c0cff6279841e8a/astroid-2.1.0-py3-none-any.whl (176 kB)
Collecting pylint==2.3.1
Downloading b3f73f4ac00277237721ef1c151f0d/pylint-2.3.1-py3-none-any.whl (765 kB)
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of astroid to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r /home/zuul/src/opendev.org/openstack/freezer/test-requirements.txt (line 23) and astroid==2.1.0 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested astroid==2.1.0
pylint 2.3.1 depends on astroid<3 and >=2.2.0
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
WARNING: You are using pip version 20.3.3; however, version 21.0 is available.
You should consider upgrading via the '/home/zuul/src/opendev.org/openstack/freezer/.tox/pep8/bin/python -m pip install --upgrade pip' command.
================================ log end ===============================
Change-Id: I898d03d716ebc6c6285c4589cd30f7875b0c51d2
1. the bug:
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "/opt/stack/freezer/freezer/tests/unit/scheduler/test_utils.py", line 53, in test_find_config_files_path
ret = utils.find_config_files(temp_path)
File "/opt/stack/freezer/freezer/scheduler/utils.py", line 53, in find_config_files
for fname in os.walk(expanded_path).next()[2]:
AttributeError: 'generator' object has no attribute 'next'
2. fix:
To get iterobject next element is changed to next(iterobject,defalt) in python3.x.
Change-Id: I558bbfecb4a9670a10b1fc649821d88619b7917c
Config parsers do not guess datatypes of values
in configuration files, always storing them internally
as strings. So, we need to test if action_v is not NoneType,
and if it is not, retype to String. Retype is needed if
we get boolean value.
Change-Id: I2ddade105a9825a82e18aaf27650d769aedee4cf
We don't support Python 2 anymore so we don't need this
compatibility library.
This patch remove six usage.
Change-Id: I661e9cdaf33e89bdb905d1f34a001f3853c4c366
At present, the codes as follows:
db/elastic/driver.py:
Def get_engine (self):
If not self._engine:
Self._engine = db_session.ElasticSearchEngineV2(self.backend)
Return self._engine
There is that freezer-api can't support support v1.
Actually, there is enable_v1_api ,but it is not used correctly.
The documents will be modified in other patches.
For example:
1)freezer-api v1:
/etc/freezer/freezer-api.conf:
[DEFAULT]
enable_v1_api = True
[storage]
driver = elasticsearch
backend = elasticsearch
[elasticsearch]
hosts = http://172.16.1.200:9200
number_of_replicas = 0
index = freezer
/etc/freezer/scheduler.conf:
[DEFAULT]
enable_v1_api = True
command: freezer --os-backup-api-version 1 job-list
2)freezer-api v2:
/etc/freezer/freezer-api.conf:
[DEFAULT]
enable_v1_api = False
or
# enable_v1_api = False
[storage]
driver = elasticsearch
backend = elasticsearch
[elasticsearch]
hosts = http://172.16.1.200:9200
number_of_replicas = 0
index = freezer
/etc/freezer/scheduler.conf:
[DEFAULT]
enable_v1_api = False
or
# enable_v1_api = False
command: freezer job-list
Change-Id: I9eb490c874efa0d752982f38f0971f80bcab14f3
When using flag --no-daemon, freezer-scheduler --no-daemon start fails with
AttributeError: 'NoDaemon' object has no attribute 'restart'
(freezer_scheduler.py: L251). This patch adds missing dummy methods for reload
and restart actions.
Change-Id: I72a0a4f68503b7c143cbe6c6f13cfbdc08e6ccbb
license boilerplates as docstring are included in automatically
generated documentation which leads to wrong formatting.
For example the indented hyperlink to the license is formatted as
quotation.
Change-Id: I9d6088ab48d6787f29b593bfa5445b6a84e99de7
This patch allows freezer-scheduler to use either API v1 or v2
You can alter it using OS_BACKUP_API_VERSION env variable
Depends-On: I83000f8bf39eed41d067ed663de9f459439eca9a
Change-Id: I2e5724b1f1a75121952e2beb3844d2c489e4df68
"CONF.action is None" in included in "CONF.action not in possible_action"
it is unnecessary. this patch to review it.
Change-Id: Ia0e21122a11ab0c1f36886b86df9613dac42f3ea
Currently, freezer-scheduler doesn't have restart command. If we
modified scheduler.conf, we should stop freezer-scheduler firstly,
and then start freezer-scheduler. Restart command can simplify the
operation of an user.
Closes-Bug: #1685192
Change-Id: Iad7ebc8a8303d151bc91030bc67d765ea0eadeab
Now, when you stop a job whose status is ScheduledState or RunningState,
freezer-scheduler will print the job stop info log many times. In fact,
whatever status the job is in, it is appropriate to print its stop info
log only when it's in StopState status.
Closes-Bug: #1685187
Change-Id: I6efe9ee67980db1d438b051cb718f49935deb23d
The local variable 'config_file_name' is not
used in the code scope, so we should remove it to
clean the code.
Change-Id: Ia660848bdb028621d7c635f13b0a973726d3caa3
Currently, freezer-scheduler process can be started
multiple times, but when we use 'freezer-scheduler
stop' to stop it, only the latest started scheduler
process will be stoped. This patch ensures the
freezer-scheduler process just start up once.
Change-Id: I4bf5bb643f364d5cf79c7ea2ccb8c6a496cd77fe
Closes-Bug: #1678033
1.As mentioned in [1], we should avoid using six.iteritems to
achieve iterators. We can use dict.items instead, as it will
return iterators in PY3 as well. And dict.items/keys will more
readable.
2.In py2, the performance about list should be negligible,
see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
Change-Id: I522e8f06e8a31b0d591db825d0c1608f162cbbc6
Openstack common has a wrapper for generating uuids. We should
use that function when generating uuids for consistency.
Change-Id: Ide5cdaf48a27e9c080fd8691b100a601f82ca2bf
Closes-Bug: #1082248
Added some configuration options were missing and were causing problems
during connection to freezer-api
Change-Id: Id3ffbf390d704e5973e2b6822168a1f8caecfa2d
In the cfg module default=None is set as the
default value. It's not necessary to set it
again when defining config options.
Change-Id: I9fc33e44fdf038684195a19027255ce1bfe61dc6
Closes-bug: #1323975
The freezer client has been switched to python-freezerclient,
the code related to use freezer-scheduler as a command line client
should be removed.
Change-Id: I999d0f2e72cf135fdf3b9373461648416c9e0902
Closes-Bug: #1645635
Signed-off-by: Shangzhong Zhu <zhu.shangzhong@zte.com.cn>
Messages about creating new directory or finding already created
directory should not be treated as "WARNING", it's normal behavior.
Also, there is no need to print this messages every execution
of scheduler.
Change-Id: I31dc9acc06b0b1556b265da9fef4ef2a74c20e06
Closes-Bug: #1646851
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Delete the directory "scheduler" under /etc/freezer/, start
freezer-scheduler, print the error info as follow:
No handlers could be found for logger "freezer.scheduler.arguments"
In the process of initializing oslo_log, _LOG.error was used to
record error info. Before the initialization is finished, the
_LOG.error can't be used to record log info.
Use freezer_utils.create_dir() to check if the directory exist or
not, if not, will create the directory. If the error occurs, The
log info will be wrote into log file.
Change-Id: I19d7b6efd52af66142c01e017e29db3792ef0398
Closes-Bug: #1627245
This patch set modifies lines which are importing objects
instead of modules. As per openstack import guide lines, user should
import modules in a file not objects.
Also, imports was regrouped and placed in alphabetical order.
http://docs.openstack.org/developer/hacking/#imports
Change-Id: I192b8bf6f50a85e19640975f0902a014c4ba0878
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
There is no need to call os.remove() with temp file,
it will be removed automatically after closed.
Actually, freezer.log has warning messages about it:
WARNING freezer.utils.utils [-] Error deleting file /tmp/tmpSNedJh
This patch will fix it.
Also, added newline to info message that using scheduler is deprecated
and more verbose output if there is a problem with deleting file.
Change-Id: I8dc31684bfece130eed6dd89806e965a4e1eabea
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
The following fields of the job document are now correctly updated
when the freezer_scheduler starts and stops a job.
- time_started
- time_ended
- result
In case of recurring job the "result" field is updated with the
result of the last job's execution.
Change-Id: I35d804b12f65d2123fdcb558b770cf6eef871d1e
Closes-Bug: #1631074
when schedule json_file has some key eg: schedule_{year, week, day}
and so on, it should trigger cron to schedule use apschedule.
But it is unavailable now. This patch should fix it use cron date.
Change-Id: I0113158d60605109fdeefe74f45f4050b5a75d7a
Closes-Bug: #1599715
Max_retries implies number of RE-Try, not number of tries.
Also, this fixes an issue if someone gave max_retries value of 0.
Change-Id: Ibf67f4a0d7c0bbd65daf93ef20fb852e5bdf868f