Skip to content

Commit 794a1fc

Browse files
author
Pavan Krishna Nimmagadda
committed
added deprecation warnings
1 parent 8542031 commit 794a1fc

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

src/python/hooks/appdynamics.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,15 @@ func (h AppdynamicsHook) CreateAppDynamicsEnv(stager *libbuildpack.Stager, envir
144144
}
145145

146146
func (h AppdynamicsHook) BeforeCompile(stager *libbuildpack.Stager) error {
147+
if os.Getenv("APPD_AGENT") != "" {
148+
// APPD_AGENT is set => multibuildpack is used to configure appdynamics agent. Do nothing.
149+
return nil
150+
}
151+
152+
h.Log.Warning("[DEPRECATION WARNING]:")
153+
h.Log.Warning("Please use AppDynamics extension buildpack for Python Application instrumentation")
154+
h.Log.Warning("for more details: https://docs.pivotal.io/partners/appdynamics/multibuildpack.html")
155+
147156
vcapServices := os.Getenv("VCAP_SERVICES")
148157
services := make(map[string][]Plan)
149158

@@ -217,13 +226,8 @@ func (h AppdynamicsHook) BeforeCompile(stager *libbuildpack.Stager) error {
217226
func init() {
218227
logger := libbuildpack.NewLogger(os.Stdout)
219228
command := &libbuildpack.Command{}
220-
if os.Getenv("APPD_AGENT") == "" {
221-
logger.Warning("[DEPRECATION WARNING]: ")
222-
logger.Warning("Please use AppDynamics extension buildpack for Python Application instrumentation")
223-
logger.Warning("for more details: https://docs.pivotal.io/partners/appdynamics/multibuildpack.html")
224-
libbuildpack.AddHook(AppdynamicsHook{
225-
Log: logger,
226-
Command: command,
227-
})
228-
}
229+
libbuildpack.AddHook(AppdynamicsHook{
230+
Log: logger,
231+
Command: command,
232+
})
229233
}

0 commit comments

Comments
 (0)