Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
431b7de0
authored
Feb 12, 2024
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agent update fix
parent
848ff728
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
circle/circle/settings/base.py
+4
-4
circle/vm/operations.py
+2
-1
No files found.
circle/circle/settings/base.py
View file @
431b7de0
...
@@ -532,7 +532,6 @@ LOGIN_REDIRECT_URL = "/"
...
@@ -532,7 +532,6 @@ LOGIN_REDIRECT_URL = "/"
AGENT_DIR
=
get_env_variable
(
AGENT_DIR
=
get_env_variable
(
'DJANGO_AGENT_DIR'
,
join
(
unicode
(
expanduser
(
"~"
)),
'agent'
))
'DJANGO_AGENT_DIR'
,
join
(
unicode
(
expanduser
(
"~"
)),
'agent'
))
# AGENT_DIR is the root directory for the agent.
# AGENT_DIR is the root directory for the agent.
# The directory structure SHOULD be:
# The directory structure SHOULD be:
# /home/username/agent
# /home/username/agent
...
@@ -544,12 +543,13 @@ AGENT_DIR = get_env_variable(
...
@@ -544,12 +543,13 @@ AGENT_DIR = get_env_variable(
#
#
try
:
try
:
git_env
=
{
'GIT_DIR'
:
join
(
join
(
AGENT_DIR
,
"agent
-linux"
),
'.git'
)}
git_env
=
{
'GIT_DIR'
:
join
(
join
(
AGENT_DIR
,
"agent
"
),
".git"
)}
AGENT_VERSION
=
check_output
(
AGENT_VERSION
=
check_output
(
(
'git'
,
'log'
,
'-1'
,
r'--pretty=format:
%
h'
,
'HEAD'
),
env
=
git_env
)
(
'git'
,
'log'
,
'-1'
,
r'--pretty=format:
%
h'
,
'HEAD'
),
env
=
git_env
)
except
:
except
:
AGENT_VERSION
=
Non
=
(
join
(
SITE_ROOT
,
'locale'
),
)
AGENT_VERSION
=
Non
=
(
join
(
SITE_ROOT
,
'locale'
),
)
print
(
"LEGACY VERSION:
%
s ------"
%
AGENT_VERSION
)
#### NEW ####
#### NEW ####
####
####
...
@@ -563,8 +563,8 @@ except:
...
@@ -563,8 +563,8 @@ except:
try
:
try
:
with
open
(
"
%
s/versions.txt"
%
AGENT_DIR
,
"r"
)
as
f
:
with
open
(
"
%
s/versions.txt"
%
AGENT_DIR
,
"r"
)
as
f
:
AGENT_VERSIONS
=
loads
(
f
.
read
())
AGENT_VERSIONS
=
loads
(
f
.
read
())
print
(
"-----KONWN VERSIONS-----"
)
print
(
"-----KONWN VERSIONS-----"
)
print
(
AGENT_VERSIONS
)
print
(
AGENT_VERSIONS
)
except
:
except
:
print
(
"Format ERROR in versions.txt !!!! "
)
# TODO more error reposrting
print
(
"Format ERROR in versions.txt !!!! "
)
# TODO more error reposrting
AGENT_VERSIONS
=
None
AGENT_VERSIONS
=
None
...
...
circle/vm/operations.py
View file @
431b7de0
...
@@ -1588,7 +1588,8 @@ class AgentStartedOperation(InstanceOperation):
...
@@ -1588,7 +1588,8 @@ class AgentStartedOperation(InstanceOperation):
self
.
instance
.
_set_hostname
(
parent_activity
=
activity
)
self
.
instance
.
_set_hostname
(
parent_activity
=
activity
)
new_version
=
settings
.
GET_AGENT_VERSION_BY_SYSTEM
(
agent_system
)[
0
]
new_version
=
settings
.
GET_AGENT_VERSION_BY_SYSTEM
(
agent_system
)[
0
]
if
agent_system
and
new_version
and
(
old_version
is
None
or
old_version
and
new_version
!=
old_version
):
# if agent_system and new_version and (old_version is None or ("NOAGENTUPDATE" not in old_version and new_version != old_version)) :
if
agent_system
and
new_version
and
old_version
and
"NOAGENTUPDATE"
not
in
old_version
and
new_version
!=
old_version
:
try
:
try
:
self
.
instance
.
update_agent
(
self
.
instance
.
update_agent
(
parent_activity
=
activity
,
agent_system
=
agent_system
)
parent_activity
=
activity
,
agent_system
=
agent_system
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment